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
| 167 | // Generates an error if the trigger cannot be found |
| 168 | // Paramaters: roomnum,facenum - the room and face with the trigger |
| 169 | trigger *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 |
| 186 | void CheckTrigger(int roomnum, int facenum, object *objp, int event_type) { |
no outgoing calls
no test coverage detected