Bazaar developer reference

CvPreGame::setHandicap(PlayerTypes, HandicapTypes)

Defined in
CvPreGame.cpp, line 2611
Hook name
CivHooks::CvPreGame_setHandicap

Hooks

static bool BeforeCvPreGame_setHandicap(PlayerTypes p, HandicapTypes h);static void AfterCvPreGame_setHandicap(PlayerTypes p, HandicapTypes h);static void ReplaceCvPreGame_setHandicap(void (*original)(PlayerTypes, HandicapTypes), PlayerTypes p, HandicapTypes h);CivRegisterBefore<CivHooks::CvPreGame_setHandicap>(host, &BeforeCvPreGame_setHandicap);CivRegisterAfter<CivHooks::CvPreGame_setHandicap>(host, &AfterCvPreGame_setHandicap);CivRegisterReplace<CivHooks::CvPreGame_setHandicap>(host, &ReplaceCvPreGame_setHandicap);

Code

2611void setHandicap(PlayerTypes p, HandicapTypes h)2612{2613	if(p >= 0 && p < MAX_PLAYERS){2614		s_handicaps.setAt(p, h);26152616		if(slotStatus(p) == SS_TAKEN){2617			//Cache the handicap of human players.  2618			//We do this so we can recall the human handicap setting if the human player happens to disconnect and get replaced by an ai.2619			setLastHumanHandicap(p, h);2620		}2621	}2622}

Calls

Called by