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

Function ObjRelink

Descent3/object.cpp:2108–2119  ·  view source on GitHub ↗

when an object has moved into a new room, this function unlinks it from its old room and links it into the new room

Source from the content-addressed store, hash-verified

2106// when an object has moved into a new room, this function unlinks it
2107// from its old room and links it into the new room
2108void ObjRelink(int objnum, int newroomnum) {
2109 ASSERT((objnum >= 0) && (objnum <= Highest_object_index));
2110
2111 if (!ROOMNUM_OUTSIDE(newroomnum)) {
2112 ASSERT((newroomnum <= Highest_room_index) && (newroomnum >= 0));
2113 ASSERT(Rooms[newroomnum].used);
2114 } else
2115 ASSERT(CELLNUM(newroomnum) >= 0 && CELLNUM(newroomnum) <= (TERRAIN_WIDTH * TERRAIN_DEPTH));
2116
2117 ObjUnlink(objnum);
2118 ObjLink(objnum, newroomnum);
2119}
2120
2121void DoCycledAnim(object *obj) {
2122 float from;

Callers 2

CombineRoomsFunction · 0.85
ObjSetPosFunction · 0.85

Calls 2

ObjUnlinkFunction · 0.85
ObjLinkFunction · 0.85

Tested by

no test coverage detected