(svn r1739) - Fix: type checking when selling vehicles (TrueLight)

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
darkvater 20 years ago
parent e3287ad303
commit 55e1eab1a2

@ -364,7 +364,7 @@ int32 CmdSellAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2)
v = GetVehicle(p1);
if (!CheckOwnership(v->owner) || !CheckStoppedInHangar(v))
if (v->type != VEH_Aircraft || !CheckOwnership(v->owner) || !CheckStoppedInHangar(v))
return CMD_ERROR;
if (flags & DC_EXEC) {

@ -919,7 +919,7 @@ int32 CmdSellShip(int x, int y, uint32 flags, uint32 p1, uint32 p2)
v = GetVehicle(p1);
if (!CheckOwnership(v->owner))
if (v->type != VEH_Ship || !CheckOwnership(v->owner))
return CMD_ERROR;
if (!IsShipDepotTile(v->tile) || v->u.road.state != 0x80 || !(v->vehstatus&VS_STOPPED))

@ -873,7 +873,7 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
v = GetVehicle(p1);
if (v->type == 0 || !CheckOwnership(v->owner))
if (v->type != VEH_Train || !CheckOwnership(v->owner))
return CMD_ERROR;
// get first vehicle in chain

Loading…
Cancel
Save