mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r1687) - Feature: [autoreplace] server now checks for plane<->helicopter replacement and reject replacement if needed
This commit is contained in:
parent
556c153a2d
commit
1d4de01a63
@ -1351,6 +1351,9 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
// check that it's the vehicle's owner that requested the replace
|
// check that it's the vehicle's owner that requested the replace
|
||||||
if (!CheckOwnership(v->owner)) return CMD_ERROR;
|
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;
|
||||||
|
|
||||||
|
|
||||||
switch (v->type) {
|
switch (v->type) {
|
||||||
case VEH_Train: build_cost = EstimateTrainCost(RailVehInfo(new_engine_type)); break;
|
case VEH_Train: build_cost = EstimateTrainCost(RailVehInfo(new_engine_type)); break;
|
||||||
|
Loading…
Reference in New Issue
Block a user