Import infrastructure sharing patch

Strip trailing whitespace
Remove a leftover line form settings.ini

http://www.tt-forums.net/viewtopic.php?p=1008843#p1008843
This commit is contained in:
patch-import
2015-08-06 22:24:24 +01:00
committed by Jonathan G Rennison
parent 856896c36e
commit ee791055f9
32 changed files with 794 additions and 66 deletions

View File

@@ -19,6 +19,7 @@
#include "../tunnelbridge.h"
#include "../tunnelbridge_map.h"
#include "../depot_map.h"
#include "../infrastructure_func.h"
#include "pf_performance_timer.hpp"
/**
@@ -298,6 +299,11 @@ protected:
m_err = EC_NO_WAY;
return false;
}
/* road stops shouldn't be entered unless allowed to */
if (!IsInfraTileUsageAllowed(VEH_ROAD, m_veh_owner, m_new_tile)) {
m_err = EC_OWNER;
return false;
}
}
/* single tram bits can only be entered from one direction */
@@ -316,8 +322,8 @@ protected:
m_err = EC_NO_WAY;
return false;
}
/* don't try to enter other company's depots */
if (GetTileOwner(m_new_tile) != m_veh_owner) {
/* don't try to enter other company's depots if not allowed */
if (!IsInfraTileUsageAllowed(VEH_ROAD, m_veh_owner, m_new_tile)) {
m_err = EC_OWNER;
return false;
}
@@ -330,8 +336,8 @@ protected:
}
}
/* rail transport is possible only on tiles with the same owner as vehicle */
if (IsRailTT() && GetTileOwner(m_new_tile) != m_veh_owner) {
/* rail transport is possible only on allowed tiles */
if (IsRailTT() && !IsInfraTileUsageAllowed(VEH_TRAIN, m_veh_owner, m_new_tile)) {
/* different owner */
m_err = EC_NO_WAY;
return false;