CvPreGame::closeInactiveSlots()
- Defined in
- CvPreGame.cpp, line 813
- Hook name
CivHooks::CvPreGame_closeInactiveSlots
Hooks
static bool BeforeCvPreGame_closeInactiveSlots();static void AfterCvPreGame_closeInactiveSlots();static void ReplaceCvPreGame_closeInactiveSlots(void (*original)());CivRegisterBefore<CivHooks::CvPreGame_closeInactiveSlots>(host, &BeforeCvPreGame_closeInactiveSlots);CivRegisterAfter<CivHooks::CvPreGame_closeInactiveSlots>(host, &AfterCvPreGame_closeInactiveSlots);CivRegisterReplace<CivHooks::CvPreGame_closeInactiveSlots>(host, &ReplaceCvPreGame_closeInactiveSlots);
Code
813void closeInactiveSlots()814{815 s_gameStarted = true;816817 // Open inactive slots mean different things to different game modes and types...818 // Let's figure out what they mean for us819 gDLL->BeginSendBundle();820 for(int i = 0; i < MAX_CIV_PLAYERS; i++)821 {822 PlayerTypes eID = (PlayerTypes)i;823 if(slotStatus(eID) == SS_OPEN)824 {825 if(gameType() == GAME_NETWORK_MULTIPLAYER && gameMapType() == GAME_SCENARIO)826 {827 // Multiplayer scenario - all "open" slots should be filled with an AI player828 setSlotStatus(eID, SS_COMPUTER);829 }830 else831 {832 // If it's a normal game, all "open" slots should be closed.833 setSlotStatus(eID, SS_CLOSED);834 }835 setSlotClaim(eID, SLOTCLAIM_UNASSIGNED);836837 gDLL->sendPlayerInfo(eID);838 }839 }840 gDLL->EndSendBundle();841}
Calls
- CvGlobals::getDLLIFace()
- CvPreGame::gameMapType()
- CvPreGame::gameType()
- CvPreGame::setSlotClaim(PlayerTypes, SlotClaim)
- CvPreGame::setSlotStatus(PlayerTypes, SlotStatus)
- CvPreGame::slotStatus(PlayerTypes)
FAutoVariable::operator=ICvEngineUtility1::sendPlayerInfoICvEngineUtility3::BeginSendBundleICvEngineUtility3::EndSendBundle