CvPreGame::VerifyHandicap(PlayerTypes)
- Defined in
- CvPreGame.cpp, line 3050
- Hook name
CivHooks::CvPreGame_VerifyHandicap
Hooks
static bool BeforeCvPreGame_VerifyHandicap(PlayerTypes p);static void AfterCvPreGame_VerifyHandicap(PlayerTypes p);static void ReplaceCvPreGame_VerifyHandicap(void (*original)(PlayerTypes), PlayerTypes p);CivRegisterBefore<CivHooks::CvPreGame_VerifyHandicap>(host, &BeforeCvPreGame_VerifyHandicap);CivRegisterAfter<CivHooks::CvPreGame_VerifyHandicap>(host, &AfterCvPreGame_VerifyHandicap);CivRegisterReplace<CivHooks::CvPreGame_VerifyHandicap>(host, &ReplaceCvPreGame_VerifyHandicap);
Code
3050void VerifyHandicap(PlayerTypes p)3051{//Verifies that the current handicap is valid for the current player.3052 //non-ai players can't use the default ai handicap and ai players MUST use it.3053 if(slotStatus(p) == SS_COMPUTER){3054 setHandicap(p, (HandicapTypes)GC.getAI_HANDICAP());3055 }3056 else if(handicap(p) == GC.getAI_HANDICAP()){3057 if(lastHumanHandicap(p) != NO_HANDICAP){3058 setHandicap(p, lastHumanHandicap(p));3059 }3060 else if(GC.getGame().isNetworkMultiPlayer()){3061 setHandicap(p, (HandicapTypes)GC.getMULTIPLAYER_HANDICAP());3062 }3063 else{3064 setHandicap(p, (HandicapTypes)GC.getSTANDARD_HANDICAP());3065 }3066 }3067}
Calls
- CvGame::isNetworkMultiPlayer() const
- CvGlobals::getAI_HANDICAP()
- CvGlobals::getGame()
- CvGlobals::getMULTIPLAYER_HANDICAP()
- CvGlobals::getSTANDARD_HANDICAP()
- CvPreGame::handicap(PlayerTypes)
- CvPreGame::lastHumanHandicap(PlayerTypes)
- CvPreGame::setHandicap(PlayerTypes, HandicapTypes)
- CvPreGame::slotStatus(PlayerTypes)