HomeWildfire Games

# Add victory/defeat conditions, based on patch from fcxSanya.


Add victory/defeat conditions, based on patch from fcxSanya.

Fixes #565.


philipOct 1 2010, 10:51 PM
rP8233: Celt scout tower variation.

Event Timeline

elexis added a subscriber: elexis.Oct 16 2019, 10:17 PM
elexis added inline comments.

Concern: The resign comannd is misleading dead code.

rP912 introduced the endGame in ScriptGlue.cpp which calls EndGame in main.cpp which does a delete g_Game.
r14772 changed endGame to Engine.EndGame(), the behavior is still the same and instantly nukes the game.

So this defeat-player command introduced in this commit rP8234 is dead code, because the command is not simulated until the next turn, but the next turn is not simulated because the game was deleted.

This dead code was preserved and transformed throughout the years, notably in rP14772 and rP18441, but it's still dead code currently.

More calls have been added later where the resign command was not even intended and not noticed that it was present in the callstack as dead code.
To be removed in D2378.

This commit rP8234 tested if the player was defeated onTick in checkPlayerState, see below and asked whether he wants to leave in that case.
rP18441 changed the exit button code to only resign and then wait for the simulation to confirm the defeat prior to exiting.

But that's only the menu route, alt+f4 still wont do anything with regards to delivering the resign.