mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Infra sharing: Disallow control over other company trains wholly in depots
See: #469
This commit is contained in:
parent
b1a1760bcc
commit
d6046086da
@ -72,7 +72,7 @@ static inline CommandCost CheckInfraUsageAllowed(VehicleType type, Owner infra_o
|
||||
*/
|
||||
static inline bool IsVehicleControlAllowed(const Vehicle *v, Owner o)
|
||||
{
|
||||
return v->owner == o || (v->type == VEH_TRAIN && IsTileOwner(v->tile, o));
|
||||
return v->owner == o || (v->type == VEH_TRAIN && IsTileOwner(v->tile, o) && !v->IsChainInDepot());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,7 +84,7 @@ static inline bool IsVehicleControlAllowed(const Vehicle *v, Owner o)
|
||||
*/
|
||||
static inline CommandCost CheckVehicleControlAllowed(const Vehicle *v)
|
||||
{
|
||||
if (v->type == VEH_TRAIN && IsTileOwner(v->tile, _current_company)) return CommandCost();
|
||||
if (v->type == VEH_TRAIN && IsTileOwner(v->tile, _current_company) && !v->IsChainInDepot()) return CommandCost();
|
||||
return CheckOwnership(v->owner);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user