Changeset - r10947:7579acb672d3
[Not reviewed]
master
0 3 0
frosch - 16 years ago 2009-01-27 19:44:36
frosch@openttd.org
(svn r15286) -Fix: Refitting did not invalidate vehicle-colour-maps of road-vehicles, ships and aircraft, as well vehicle-length of road-vehicles.
3 files changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/aircraft_cmd.cpp
Show inline comments
 
@@ -593,6 +593,7 @@ CommandCost CmdRefitAircraft(TileIndex t
 
		u->cargo.Truncate(v->cargo_type == new_cid ? mail : 0);
 
		v->cargo_type = new_cid;
 
		v->cargo_subtype = new_subtype;
 
		v->colormap = PAL_NONE; // invalidate vehicle colour map
 
		InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 
		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
		InvalidateWindowClassesData(WC_AIRCRAFT_LIST, 0);
src/roadveh_cmd.cpp
Show inline comments
 
@@ -47,6 +47,7 @@
 
#include "core/alloc_func.hpp"
 

	
 
#include "table/strings.h"
 
#include "table/sprites.h"
 

	
 
static const uint16 _roadveh_images[63] = {
 
	0xCD4, 0xCDC, 0xCE4, 0xCEC, 0xCF4, 0xCFC, 0xD0C, 0xD14,
 
@@ -160,6 +161,9 @@ void RoadVehUpdateCache(Vehicle *v)
 

	
 
		/* Update the length of the vehicle. */
 
		u->u.road.cached_veh_length = GetRoadVehLength(u);
 

	
 
		/* Invalidate the vehicle colour map */
 
		u->colormap = PAL_NONE;
 
	}
 
}
 

	
 
@@ -2099,6 +2103,8 @@ CommandCost CmdRefitRoadVeh(TileIndex ti
 
		if (only_this) break;
 
	}
 

	
 
	if (flags & DC_EXEC) RoadVehUpdateCache(GetVehicle(p1)->First());
 

	
 
	_returned_refit_capacity = total_capacity;
 

	
 
	return cost;
src/ship_cmd.cpp
Show inline comments
 
@@ -44,6 +44,7 @@
 
#include "ai/ai.hpp"
 

	
 
#include "table/strings.h"
 
#include "table/sprites.h"
 

	
 
static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
 

	
 
@@ -953,6 +954,7 @@ CommandCost CmdRefitShip(TileIndex tile,
 
		v->cargo.Truncate((v->cargo_type == new_cid) ? capacity : 0);
 
		v->cargo_type = new_cid;
 
		v->cargo_subtype = new_subtype;
 
		v->colormap = PAL_NONE; // invalidate vehicle colour map
 
		InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 
		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
		InvalidateWindowClassesData(WC_SHIPS_LIST, 0);
0 comments (0 inline, 0 general)