CvPreGame::isPlayable(PlayerTypes)
- Defined in
- CvPreGame.cpp, line 1196
- Hook name
CivHooks::CvPreGame_isPlayable
Hooks
static bool BeforeCvPreGame_isPlayable(PlayerTypes p, bool& result);static void AfterCvPreGame_isPlayable(PlayerTypes p, bool& result);static bool ReplaceCvPreGame_isPlayable(bool (*original)(PlayerTypes), PlayerTypes p);CivRegisterBefore<CivHooks::CvPreGame_isPlayable>(host, &BeforeCvPreGame_isPlayable);CivRegisterAfter<CivHooks::CvPreGame_isPlayable>(host, &AfterCvPreGame_isPlayable);CivRegisterReplace<CivHooks::CvPreGame_isPlayable>(host, &ReplaceCvPreGame_isPlayable);
Code
1196bool isPlayable(PlayerTypes p)1197{1198 if(p >= 0 && p < MAX_PLAYERS)1199 {1200 if(isWBMapScript() && !mapNoPlayers())1201 {1202 return s_playableCivs[p];1203 }1204 else1205 {1206 if(civilization(p) != NO_CIVILIZATION)1207 {1208 return s_civilizationKeysPlayable[p];1209 }1210 else1211 {1212 // Don't allow people to play the barbarian civ1213 return (p < MAX_CIV_PLAYERS);1214 }1215 }1216 }12171218 return false;1219}
Calls
- CvPreGame::civilization(PlayerTypes)
- CvPreGame::isWBMapScript()
- CvPreGame::mapNoPlayers()
FAutoVariable::operator[]std::_Vb_reference::operator boolstd::vector::operator[]