CancelActivePlayerEndTurn()
- Defined in
- CvPlayer.cpp, line 28100
- Hook name
CivHooks::CancelActivePlayerEndTurn
Hooks
static bool BeforeCancelActivePlayerEndTurn(bool& result);static void AfterCancelActivePlayerEndTurn(bool& result);static bool ReplaceCancelActivePlayerEndTurn(bool (*original)());CivRegisterBefore<CivHooks::CancelActivePlayerEndTurn>(host, &BeforeCancelActivePlayerEndTurn);CivRegisterAfter<CivHooks::CancelActivePlayerEndTurn>(host, &AfterCancelActivePlayerEndTurn);CivRegisterReplace<CivHooks::CancelActivePlayerEndTurn>(host, &ReplaceCancelActivePlayerEndTurn);
Code
28096// If the active player is in the end-turn processing phase, attempt to cancel that.28097// This should be called when something occurs that could happen during the end-turn28098// that may need the players attention this turn.28099// Ex. A player's unit auto-moves into a goody hut plot.28100bool CancelActivePlayerEndTurn()28101{28102 CvPlayer& kActivePlayer = GET_PLAYER(GC.getGame().getActivePlayer());2810328104 if(kActivePlayer.isLocalPlayer() && kActivePlayer.isEndTurn())28105 {28106 if (gDLL->sendTurnUnready()) // This will see if we can actually do the unready, sometimes you can't in MP games.28107 {28108 kActivePlayer.setEndTurn(false);28109 return true;28110 }28111 return false;28112 }28113 return true;28114}
Calls
Called by
- CvMinorCivAI::DoFirstContactWithMajor(TeamTypes, bool)
- CvPlayer::acquireCity(CvCity *, bool, bool, bool)
- CvPlayer::doGoody(CvPlot *, CvUnit *)
- CvPlayer::receiveGoody(CvPlot *, GoodyTypes, CvUnit *)
- CvPlot::changeBuildProgress(BuildTypes, int, PlayerTypes)
- CvPlot::setRevealed(TeamTypes, bool, CvUnit *, bool, TeamTypes)
- CvUnit::createCaptureUnit(const CvUnitCaptureDefinition &)
- CvUnit::setXY(int, int, bool, bool, bool, bool, bool)