// //////////////////////////////////////////////////////////////////////////// static BOOL gameInit(void) { UDWORD player; scriptInit(); // If this is from a savegame, stop here! if (getSaveGameType() == GTYPE_SAVE_START || getSaveGameType() == GTYPE_SAVE_MIDMISSION) { // these two lines are the biggest hack in the world. // the reticule seems to get detached from 'reticuleup' // this forces it back in sync... intRemoveReticule(); intAddReticule(); return true; } for(player = 0; player<game.maxPlayers; player++) // clean up only to the player limit for this map.. { cleanMap(player); } for (player = 1; player < MAX_PLAYERS; player++) { // we want to remove disabled AI & all the other players that don't belong if ((game.skDiff[player] == 0 || player >= game.maxPlayers) && (!game.scavengers || player != 7)) { clearPlayer(player, true); // do this quietly debug(LOG_NET, "removing disabled AI (%d) from map.", player); } } if (game.scavengers) // FIXME - not sure if we still need this hack - Per { // ugly hack for now game.skDiff[7] = DIFF_SLIDER_STOPS / 2; } if (NetPlay.isHost) // add oil drums { addOilDrum(NetPlay.playercount * 2); } playerResponding(); // say howdy! return true; }
// //////////////////////////////////////////////////////////////////////////// static bool gameInit(void) { UDWORD player; // If this is from a savegame, stop here! if (getSaveGameType() == GTYPE_SAVE_START || getSaveGameType() == GTYPE_SAVE_MIDMISSION) { // these two lines are the biggest hack in the world. // the reticule seems to get detached from 'reticuleup' // this forces it back in sync... intRemoveReticule(); intAddReticule(); return true; } for (player = 1; player < MAX_PLAYERS; player++) { // we want to remove disabled AI & all the other players that don't belong if ((game.skDiff[player] == 0 || player >= game.maxPlayers) && player != scavengerPlayer()) { clearPlayer(player, true); // do this quietly debug(LOG_NET, "removing disabled AI (%d) from map.", player); } } if (game.scavengers) // FIXME - not sure if we still need this hack - Per { // ugly hack for now game.skDiff[scavengerPlayer()] = DIFF_SLIDER_STOPS / 2; } unsigned playerCount = 0; for (int index = 0; index < game.maxPlayers; ++index) { playerCount += NetPlay.players[index].ai >= 0 || NetPlay.players[index].allocated; } addOilDrum(playerCount * 2); // Calculating playerCount instead of using NetPlay.playercount, since the latter seems to be 0 for non-hosts. playerResponding(); // say howdy! return true; }