MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / removeAllSubjectRefs

Function removeAllSubjectRefs

src/OpenLoco/src/MessageManager.cpp:475–496  ·  view source on GitHub ↗

0x0042851C

Source from the content-addressed store, hash-verified

473
474 // 0x0042851C
475 void removeAllSubjectRefs(const uint16_t subject, MessageItemArgumentType type)
476 {
477 for (auto i = getNumMessages(); i > 0; --i)
478 {
479 auto& message = rawMessages()[i];
480 const auto& descriptor = getMessageTypeDescriptor(message.type);
481 bool hasModified = false;
482 for (auto j = 0; j < Message::kNumSubjects; ++j)
483 {
484 if (descriptor.argumentTypes[j] == type
485 && message.itemSubjects[j] == subject)
486 {
487 message.itemSubjects[j] = 0xFFFF;
488 hasModified = true;
489 }
490 }
491 if (hasModified && getGameState().activeMessageIndex == static_cast<MessageId>(i))
492 {
493 Ui::WindowManager::invalidate(Ui::WindowType::news);
494 }
495 }
496 }
497
498 // 0x004284DB
499 void updateDaily()

Callers 6

deallocateStationFunction · 0.85
aiDestroyFunction · 0.85
deleteTrainFunction · 0.85
createNewVehicleFunction · 0.85
removeIndustryFunction · 0.85
removeTownFunction · 0.85

Calls 2

getNumMessagesFunction · 0.85
invalidateFunction · 0.70

Tested by

no test coverage detected