(svn r6369) -Fix (r5886): On loading of game in scenario editor the player was given
authorDarkvater
Sun, 03 Sep 2006 23:02:42 +0000
changeset 4540 ceddbcae93d9
parent 4539 0004dc6c3777
child 4541 62465fe43564
(svn r6369) -Fix (r5886): On loading of game in scenario editor the player was given
the maximum amount of money so everything can be removed for sure. However
if first rails are removed (or property in general that *gives* money
when demolished, the player's money would overflow. Thanks for noticing Rubidium.
economy.c
--- a/economy.c	Sun Sep 03 22:39:02 2006 +0000
+++ b/economy.c	Sun Sep 03 23:02:42 2006 +0000
@@ -246,9 +246,10 @@
 	_current_player = old_player;
 
 	/* Temporarily increase the player's money, to be sure that
-	* removing his/her property doesn't fail because of lack of money */
+	* removing his/her property doesn't fail because of lack of money.
+	* Not too drastically though, because it could overflow */
 	if (new_player == OWNER_SPECTATOR) {
-		GetPlayer(old_player)->money64 = ((uint64)-1)>>1; // jackpot ;p
+		GetPlayer(old_player)->money64 = MAX_UVALUE(uint64) >>2; // jackpot ;p
 		UpdatePlayerMoney32(GetPlayer(old_player));
 	}