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

Function GetGoalRoomForTeam

Descent3/Player.cpp:3332–3343  ·  view source on GitHub ↗

Returns the goal room of the passed in team

Source from the content-addressed store, hash-verified

3330
3331// Returns the goal room of the passed in team
3332int GetGoalRoomForTeam(int teamnum) {
3333 ASSERT(teamnum >= 0 && teamnum <= 3);
3334 int flags[] = {RF_GOAL1, RF_GOAL2, RF_GOAL3, RF_GOAL4};
3335
3336 for (int i = 0; i <= Highest_room_index; i++) {
3337 if (Rooms[i].used && (Rooms[i].flags & flags[teamnum])) {
3338 return i;
3339 }
3340 }
3341
3342 return -1; // No goal for this team!
3343}
3344
3345// Returns the goal room of the passed in player
3346int GetGoalRoomForPlayer(int slot) {

Callers 2

MultiPaintGoalRoomsFunction · 0.85
GetGoalRoomForPlayerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected