Auto-translated
First: if player 2 captures the Elven town, you must lose, but the game continues.
It doesn't continue - you lose.
It would also be good to make it so that the lostDragon function exits the loop when dragon==0, so there are no constant, meaningless checks.