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

Function FindViewerObject

editor/HView.cpp:219–232  ·  view source on GitHub ↗

Finds a specific viewer object it one exists Parameters: id - which viewer id Returns: object number of a viewer object, or -1 if none

Source from the content-addressed store, hash-verified

217// Parameters: id - which viewer id
218// Returns: object number of a viewer object, or -1 if none
219int 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

Callers 3

FindNextViewerObjectFunction · 0.85
SetEditorViewerFunction · 0.85
ResetRoomViewerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected