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

Function GetSwitchTrigger

TombEngine/Game/control/trigger.cpp:90–120  ·  view source on GitHub ↗

NOTE: attatchedToSwitch parameter unused.

Source from the content-addressed store, hash-verified

88
89// NOTE: attatchedToSwitch parameter unused.
90int GetSwitchTrigger(ItemInfo* item, short* itemNumbersPtr, int attatchedToSwitch)
91{
92 short* triggerIndexPtr = GetTriggerIndex(item);
93 if (triggerIndexPtr == nullptr)
94 return 0;
95
96 short* trigger = triggerIndexPtr;
97 if (*trigger & END_BIT)
98 return 0;
99
100 trigger += 2;
101 short* currentPtr = itemNumbersPtr;
102 int k = 0;
103
104 do
105 {
106 if (TRIG_BITS(*trigger) == TO_OBJECT && item != &g_Level.Items[*trigger & VALUE_BITS])
107 {
108 currentPtr[k] = *trigger & VALUE_BITS;
109 ++k;
110 }
111
112 if (*trigger & END_BIT)
113 break;
114
115 ++trigger;
116
117 } while (true);
118
119 return k;
120}
121
122bool SwitchTrigger(short itemNumber, short timer)
123{

Callers 7

ProcessShootSwitchFunction · 0.85
TurnSwitchCollisionFunction · 0.85
ControlExplosionFunction · 0.85
InitializeRaisingCogFunction · 0.85
RaisingCogControlFunction · 0.85
ScalesControlFunction · 0.85
ElementPuzzleControlFunction · 0.85

Calls 1

GetTriggerIndexFunction · 0.85

Tested by

no test coverage detected