Finds a specific viewer object it one exists Parameters: id - which viewer id Returns: object number of a viewer object, or -1 if none
| 217 | // Parameters: id - which viewer id |
| 218 | // Returns: object number of a viewer object, or -1 if none |
| 219 | int FindViewerObject(int id) { |
| 220 | object *objp; |
| 221 | int objnum = -1; |
| 222 | |
| 223 | // trace through all objects looking for viewer |
| 224 | for (objnum = 0, objp = Objects; objnum <= Highest_object_index; objnum++, objp++) |
| 225 | if ((objp->type == OBJ_VIEWER) && (objp->id == id)) |
| 226 | break; |
| 227 | |
| 228 | if (objnum <= Highest_object_index) // found one |
| 229 | return objnum; |
| 230 | else |
| 231 | return -1; |
| 232 | } |
| 233 | |
| 234 | // Finds a viewer object if one exists. |
| 235 | // Starts looking at the specified id and searches through all possible ids |
no outgoing calls
no test coverage detected