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

Function Trigger

TombEngine/Game/control/trigger.cpp:375–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375void Trigger(short const value, short const flags)
376{
377 ItemInfo* item = &g_Level.Items[value];
378
379 if (item->Flags & IFLAG_KILLED)
380 return;
381
382 item->Flags |= TRIGGERED;
383
384 if (flags & ONESHOT)
385 item->Flags |= ONESHOT;
386
387 if (!item->Active)
388 {
389 if (Objects[item->ObjectNumber].intelligent)
390 {
391 if (item->Status != ITEM_NOT_ACTIVE)
392 {
393 if (item->Status == ITEM_INVISIBLE)
394 {
395 if (EnableEntityAI(value, false))
396 {
397 AddActiveItem(value);
398 }
399 else
400 {
401 item->Status = ITEM_INVISIBLE;
402 AddActiveItem(value);
403 return;
404 }
405 }
406 }
407 else
408 {
409 AddActiveItem(value);
410 EnableEntityAI(value, true);
411 }
412 }
413 else
414 {
415 AddActiveItem(value);
416 }
417
418 item->Status = ITEM_ACTIVE;
419 item->TouchBits = NO_JOINT_BITS;
420 item->DisableInterpolation = true;
421 }
422}
423
424void TestTriggers(int x, int y, int z, FloorInfo* floor, Activator activator, bool heavy, int heavyFlags)
425{

Callers 4

TestTriggersFunction · 0.85
LaraCheatFunction · 0.85
CollectCarriedItemsFunction · 0.85
EnableItemMethod · 0.85

Calls 2

EnableEntityAIFunction · 0.85
AddActiveItemFunction · 0.85

Tested by 1

TestTriggersFunction · 0.68