MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / AlertAllGuards

Function AlertAllGuards

TombEngine/Game/control/box.cpp:521–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521void AlertAllGuards(short itemNumber)
522{
523 for (int i = 0; i < ActiveCreatures.size(); i++)
524 {
525 auto* creature = GetCreatureInfo(&g_Level.Items[ActiveCreatures[i]]);
526
527 if (creature->ItemNumber == NO_VALUE)
528 continue;
529
530 auto* target = &g_Level.Items[creature->ItemNumber];
531 short objNumber = g_Level.Items[itemNumber].ObjectNumber;
532 if (objNumber == target->ObjectNumber)
533 {
534 if (target->Status == ITEM_ACTIVE)
535 creature->Alerted = true;
536 }
537 }
538}
539
540/**
541 * @brief Marks a pathfinding box as temporarily invalid ("bad") for the creature.

Callers 15

MPGunControlFunction · 0.85
CivvyControlFunction · 0.85
FlameThrowerControlFunction · 0.85
MPStickControlFunction · 0.85
MonkeyControlFunction · 0.85
TribemanDartsControlFunction · 0.85
CompsognathusControlFunction · 0.85
ControlSealMutantFunction · 0.85
HeavyGuardControlFunction · 0.85
GuardControlFunction · 0.85
Mafia2ControlFunction · 0.85
Tr5DogControlFunction · 0.85

Calls 2

GetCreatureInfoFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected