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

Function IsLizardActiveNearby

TombEngine/Objects/TR3/Entity/PunaBoss.cpp:123–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 }
122
123 static bool IsLizardActiveNearby(const ItemInfo& item, bool isInitializing = false)
124 {
125 for (auto& currentEntity : g_Level.Items)
126 {
127 // Check if the entity is a lizard.
128 if (currentEntity.ObjectNumber != ID_LIZARD)
129 continue;
130
131 // Check if the entity is in the same room as Puna.
132 if (currentEntity.RoomNumber != item.RoomNumber)
133 continue;
134
135 // If the entity is currently initializing, return early.
136 if (isInitializing)
137 return true;
138
139 // Check status of entity.
140 if (currentEntity.HitPoints > 0 &&
141 currentEntity.Status == ITEM_INVISIBLE &&
142 !(currentEntity.Flags & IFLAG_KILLED))
143 {
144 return true;
145 }
146 }
147
148 return false;
149 }
150
151 static void SpawnSummonSmoke(const Vector3& pos)
152 {

Callers 2

InitializePunaFunction · 0.85
PunaControlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected