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

Function FindTrigger

Descent3/trigger.cpp:169–183  ·  view source on GitHub ↗

Returns a pointer to the trigger attached to the given room:face Generates an error if the trigger cannot be found Paramaters: roomnum,facenum - the room and face with the trigger

Source from the content-addressed store, hash-verified

167// Generates an error if the trigger cannot be found
168// Paramaters: roomnum,facenum - the room and face with the trigger
169trigger *FindTrigger(int roomnum, int facenum) {
170 face *fp = &Rooms[roomnum].faces[facenum];
171 trigger *tp;
172 int i;
173
174 // Go through all the triggers & look for the requested one
175 for (i = 0, tp = Triggers; i < Num_triggers; i++, tp++)
176 if (tp->roomnum == roomnum)
177 if (tp->facenum == facenum)
178 return tp;
179
180 Int3(); // Didn't find the requested trigger -- very bad!
181
182 return NULL;
183}
184
185// Called to see if a trigger was tripped
186void CheckTrigger(int roomnum, int facenum, object *objp, int event_type) {

Callers 4

UpdateDialogMethod · 0.85
CombineRoomsFunction · 0.85
CheckTriggerFunction · 0.85
DeleteTriggerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected