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

This commit is contained in:
darkvater 2005-01-30 18:51:08 +00:00
parent 39c55d0eb3
commit bc0198a4c3
3 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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))

View File

@ -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