Changeset - r3:e0ae611b04b0
[Not reviewed]
master
0 1 0
darkvater - 20 years ago 2004-08-10 14:33:37
darkvater@openttd.org
(svn r4) -Fix [996025] _local_player fixes. Fixes wrong memory access (TrueLight)
1 file changed with 9 insertions and 9 deletions:
0 comments (0 inline, 0 general)
misc_gui.c
Show inline comments
 
@@ -126,34 +126,34 @@ static void Place_LandInfo(uint tile)
 
	static LandInfoData lid;
 
	Window *w;
 
	int64 old_money;
 

	
 
	DeleteWindowById(WC_LAND_INFO, 0);
 

	
 
	w = AllocateWindowDesc(&_land_info_desc);
 
	WP(w,void_d).data = &lid;
 
	
 
	lid.tile = tile;
 
	lid.town = ClosestTownFromTile(tile, _patches.dist_local_authority);
 

	
 
	if (_local_player == 255) {
 
		lid.costclear = 0;
 
	} else {
 
	if (_local_player >= MAX_PLAYERS)
 
		p = DEREF_PLAYER(0);
 
	else
 
		p = DEREF_PLAYER(_local_player);
 
		old_money = p->money64;
 
		p->money64 = p->player_money = 0x7fffffff;
 
		lid.costclear = DoCommandByTile(tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR);
 
		p->money64 = old_money;
 
		UpdatePlayerMoney32(p);
 
	}
 

	
 
	old_money = p->money64;
 
	p->money64 = p->player_money = 0x7fffffff;
 
	lid.costclear = DoCommandByTile(tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR);
 
	p->money64 = old_money;
 
	UpdatePlayerMoney32(p);
 

	
 
	GetAcceptedCargo(tile, &lid.ac);
 
	GetTileDesc(tile, &lid.td);
 
	
 
#if defined(_DEBUG)
 
	{
 
		printf("TILE: %#x (%i,%i)\n", tile, GET_TILE_X(tile), GET_TILE_Y(tile));
 
		printf("_map_type_and_height=%#x\n", _map_type_and_height[tile]);
 
		printf("_map2=%#x\n", _map2[tile]);
 
		printf("_map3_lo=%#x\n", _map3_lo[tile]);
 
		printf("_map3_hi=%#x\n", _map3_hi[tile]);
 
		printf("_map5=%#x\n", _map5[tile]);
0 comments (0 inline, 0 general)