MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DeleteTrigger

Function DeleteTrigger

Descent3/trigger.cpp:330–347  ·  view source on GitHub ↗

Remove a trigger Paramters: trig_num - the trigger to delete

Source from the content-addressed store, hash-verified

328// Remove a trigger
329// Paramters: trig_num - the trigger to delete
330void DeleteTrigger(int trig_num) {
331 trigger *tp = &Triggers[trig_num];
332 room *rp = &Rooms[tp->roomnum];
333 face *fp = &rp->faces[tp->facenum];
334
335 // Clear the face flag
336 fp->flags &= ~FF_HAS_TRIGGER;
337
338 // Free the script for this trigger
339 FreeTriggerScript(tp);
340
341 // Move other triggers down in list
342 for (int i = trig_num; i < Num_triggers - 1; i++)
343 Triggers[i] = Triggers[i + 1];
344
345 // Update count
346 Num_triggers--;
347}
348
349// Remove a trigger
350// Paramters: roomnum,facenum - where the trigger is

Callers 3

DeleteRoomFaceFunction · 0.85
OnTrigDeleteMethod · 0.85
DeleteRoomFromMineFunction · 0.85

Calls 2

FreeTriggerScriptFunction · 0.85
FindTriggerFunction · 0.85

Tested by

no test coverage detected