(svn r4) -Fix [996025] _local_player fixes. Fixes wrong memory access (TrueLight)

This commit is contained in:
darkvater 2004-08-10 14:33:37 +00:00
parent e4940ebc79
commit cc8080f2dc
1 changed files with 9 additions and 9 deletions

View File

@ -135,16 +135,16 @@ static void Place_LandInfo(uint tile)
lid.tile = tile; lid.tile = tile;
lid.town = ClosestTownFromTile(tile, _patches.dist_local_authority); lid.town = ClosestTownFromTile(tile, _patches.dist_local_authority);
if (_local_player == 255) { if (_local_player >= MAX_PLAYERS)
lid.costclear = 0; p = DEREF_PLAYER(0);
} else { else
p = DEREF_PLAYER(_local_player); p = DEREF_PLAYER(_local_player);
old_money = p->money64;
p->money64 = p->player_money = 0x7fffffff; old_money = p->money64;
lid.costclear = DoCommandByTile(tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR); p->money64 = p->player_money = 0x7fffffff;
p->money64 = old_money; lid.costclear = DoCommandByTile(tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR);
UpdatePlayerMoney32(p); p->money64 = old_money;
} UpdatePlayerMoney32(p);
GetAcceptedCargo(tile, &lid.ac); GetAcceptedCargo(tile, &lid.ac);
GetTileDesc(tile, &lid.td); GetTileDesc(tile, &lid.td);