Sets up the players array
| 1181 | |
| 1182 | // Sets up the players array |
| 1183 | void InitPlayers() { |
| 1184 | int i; |
| 1185 | |
| 1186 | // find the ships that are allowed by default |
| 1187 | Default_ship_permission = 0; |
| 1188 | for (i = 0; i < MAX_SHIPS; i++) { |
| 1189 | if (Ships[i].used & Ships[i].flags & SF_DEFAULT_ALLOW) { |
| 1190 | int flag = 0x01; |
| 1191 | flag = flag << i; |
| 1192 | Default_ship_permission |= flag; |
| 1193 | } |
| 1194 | } |
| 1195 | |
| 1196 | for (i = 0; i < MAX_PLAYERS; i++) { |
| 1197 | Players[i].startpos_flags = 0; |
| 1198 | |
| 1199 | int index = AllocTexture(); |
| 1200 | |
| 1201 | ASSERT(index >= 0); |
| 1202 | GameTextures[index].bm_handle = 0; |
| 1203 | snprintf(GameTextures[index].name, sizeof(GameTextures[index].name), "Player %d texture", i); |
| 1204 | Players[i].custom_texture_handle = index; |
| 1205 | } |
| 1206 | PlayerResetShipPermissions(-1, true); |
| 1207 | Players_typing = 0; |
| 1208 | } |
| 1209 | |
| 1210 | // Look for player objects & set player starts |
| 1211 | void FindPlayerStarts() { |
no test coverage detected