Changeset - r1187:a7e7bc855e24
[Not reviewed]
master
0 1 0
bjarni - 19 years ago 2005-01-26 19:43:22
bjarni@openttd.org
(svn r1690) - Fix: [autoreplace] Cheaters can no longer exploit autoreplace to get vehicles, that's not invented yet
- Fix: [autoreplace] Fixed a stupid bug introduced in r1687, that made a crash if anybody tried to autoreplace anything but an aircraft
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
vehicle.c
Show inline comments
 
@@ -1352,8 +1352,12 @@ int32 CmdReplaceVehicle(int x, int y, ui
 
	if (!CheckOwnership(v->owner)) return CMD_ERROR;
 

	
 
	// makes sure that we do not replace a plane with a helicopter or vise versa
 
	if (HASBIT(AircraftVehInfo(old_engine_type)->subtype, 0) != HASBIT(AircraftVehInfo(new_engine_type)->subtype, 0)) return CMD_ERROR;
 
	if (v->type == VEH_Aircraft) {
 
		if (HASBIT(AircraftVehInfo(old_engine_type)->subtype, 0) != HASBIT(AircraftVehInfo(new_engine_type)->subtype, 0)) return CMD_ERROR;
 
	}
 

	
 
	// makes sure that the player can actually buy the new engine. Renewing is still allowed to outdated engines
 
	if (!HASBIT(DEREF_ENGINE(new_engine_type)->player_avail, v->owner) && old_engine_type != new_engine_type) return CMD_ERROR;
 

	
 
	switch (v->type) {
 
		case VEH_Train:    build_cost = EstimateTrainCost(RailVehInfo(new_engine_type)); break;
0 comments (0 inline, 0 general)