Changeset - r7768:02ac79c4ccbd
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-10-20 20:15:34
rubidium@openttd.org
(svn r11317) -Fix [FS#1355]: don't read a variable of a destroyed vehicle as the value will be reset to 0.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/roadveh_cmd.cpp
Show inline comments
 
@@ -367,6 +367,8 @@ CommandCost CmdSellRoadVeh(TileIndex til
 
		return_cmd_error(STR_9013_MUST_BE_STOPPED_INSIDE);
 
	}
 

	
 
	CommandCost ret(-v->value);
 

	
 
	if (flags & DC_EXEC) {
 
		// Invalidate depot
 
		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
@@ -377,7 +379,7 @@ CommandCost CmdSellRoadVeh(TileIndex til
 
		delete v;
 
	}
 

	
 
	return CommandCost(-v->value);
 
	return ret;
 
}
 

	
 
struct RoadFindDepotData {
0 comments (0 inline, 0 general)