| 1065 | } |
| 1066 | |
| 1067 | void levelgoals::DoFrame() { |
| 1068 | int i; |
| 1069 | |
| 1070 | // Check for auto-completion |
| 1071 | for (i = 0; i < m_num_goals; i++) { |
| 1072 | int flags; |
| 1073 | m_goal[i].GetStatus(i, LO_GET_SPECIFIED, &flags); |
| 1074 | |
| 1075 | if (!(flags & (LGF_COMPLETED | LGF_FAILED))) { |
| 1076 | if (flags & LGF_ENABLED) { |
| 1077 | char ctype; |
| 1078 | int chandle; |
| 1079 | bool cdone; |
| 1080 | bool f_done = true; |
| 1081 | |
| 1082 | m_goal[i].ItemInfo(0, LO_GET_SPECIFIED, &ctype, &chandle, &cdone); |
| 1083 | |
| 1084 | if (ctype == LIT_TERRAIN_CELL) { |
| 1085 | if (Game_mode & GM_MULTI) { |
| 1086 | int j; |
| 1087 | |
| 1088 | for (j = 0; j < MAX_PLAYERS; j++) { |
| 1089 | if ((NetPlayers[j].flags & NPF_CONNECTED) && (NetPlayers[j].sequence >= NETSEQ_PLAYING)) { |
| 1090 | object *player = &Objects[Players[j].objnum]; |
| 1091 | if (!ROOMNUM_OUTSIDE(player->roomnum)) { |
| 1092 | f_done = false; |
| 1093 | } |
| 1094 | } |
| 1095 | } |
| 1096 | } else { |
| 1097 | if (!ROOMNUM_OUTSIDE(Player_object->roomnum)) { |
| 1098 | f_done = false; |
| 1099 | } |
| 1100 | } |
| 1101 | } else if (ctype == LIT_ANY_MINE) { |
| 1102 | if (Game_mode & GM_MULTI) { |
| 1103 | int j; |
| 1104 | |
| 1105 | for (j = 0; j < MAX_PLAYERS; j++) { |
| 1106 | if ((NetPlayers[j].flags & NPF_CONNECTED) && (NetPlayers[j].sequence >= NETSEQ_PLAYING)) { |
| 1107 | object *player = &Objects[Players[j].objnum]; |
| 1108 | if (ROOMNUM_OUTSIDE(player->roomnum)) { |
| 1109 | f_done = false; |
| 1110 | } |
| 1111 | } |
| 1112 | } |
| 1113 | } else { |
| 1114 | if (ROOMNUM_OUTSIDE(Player_object->roomnum)) { |
| 1115 | f_done = false; |
| 1116 | } |
| 1117 | } |
| 1118 | } else { |
| 1119 | continue; |
| 1120 | } |
| 1121 | |
| 1122 | if (f_done) { |
| 1123 | int flags = LGF_COMPLETED; |
| 1124 | m_goal[i].GetStatus(i, LO_SET_SPECIFIED, &flags); |
nothing calls this directly
no test coverage detected