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

Function Antitrigger

TombEngine/Game/control/trigger.cpp:342–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342void Antitrigger(short const value, short const flags)
343{
344 ItemInfo* item = &g_Level.Items[value];
345
346 if (item->Flags & IFLAG_KILLED)
347 return;
348
349 if (item->ObjectNumber == ID_EARTHQUAKE) // HACK: move to earthquake control function!
350 {
351 item->ItemFlags[0] = 0;
352 item->ItemFlags[1] = 100;
353 }
354
355 item->Flags &= ~(CODE_BITS | IFLAG_REVERSE);
356
357 if (flags & ONESHOT)
358 item->Flags |= ATONESHOT;
359
360 if (Objects[item->ObjectNumber].intelligent)
361 {
362 if (item->Active)
363 {
364 DisableEntityAI(value);
365 RemoveActiveItem(value, false);
366 item->Status = ITEM_INVISIBLE;
367 }
368 }
369 else
370 {
371 item->Status = ITEM_DEACTIVATED;
372 }
373}
374
375void Trigger(short const value, short const flags)
376{

Callers 2

TestTriggersFunction · 0.85
DisableItemMethod · 0.85

Calls 2

DisableEntityAIFunction · 0.85
RemoveActiveItemFunction · 0.85

Tested by 1

TestTriggersFunction · 0.68