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

Function KeyTrigger

TombEngine/Game/control/trigger.cpp:233–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233int KeyTrigger(short itemNumber)
234{
235 auto* item = &g_Level.Items[itemNumber];
236 const auto& player = Lara;
237
238 if ((item->Status != ITEM_ACTIVE || player.Control.HandStatus == HandStatus::Busy) &&
239 (!KeyTriggerActive || player.Control.HandStatus != HandStatus::Busy))
240 {
241 return -1;
242 }
243
244 int oldkey = KeyTriggerActive;
245
246 if (!oldkey)
247 item->Status = ITEM_DEACTIVATED;
248
249 KeyTriggerActive = false;
250
251 return oldkey;
252}
253
254bool PickupTrigger(short itemNumber)
255{

Callers 1

TestTriggersFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestTriggersFunction · 0.68