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.