mirror of https://github.com/OpenTTD/OpenTTD.git
This commit is contained in:
parent
a857ed8240
commit
c179c10048
|
@ -1703,6 +1703,7 @@ function Regression::Vehicle()
|
||||||
print(" BuildVehicle(): " + AIVehicle.BuildVehicle(33417, 153));
|
print(" BuildVehicle(): " + AIVehicle.BuildVehicle(33417, 153));
|
||||||
print(" IsValidVehicle(12): " + AIVehicle.IsValidVehicle(12));
|
print(" IsValidVehicle(12): " + AIVehicle.IsValidVehicle(12));
|
||||||
print(" CloneVehicle(): " + AIVehicle.CloneVehicle(33417, 12, true));
|
print(" CloneVehicle(): " + AIVehicle.CloneVehicle(33417, 12, true));
|
||||||
|
print(" BuildVehicle(): " + AIVehicle.BuildVehicle(-1, 153));
|
||||||
|
|
||||||
local bank_after = AICompany.GetBankBalance(AICompany.COMPANY_SELF);
|
local bank_after = AICompany.GetBankBalance(AICompany.COMPANY_SELF);
|
||||||
|
|
||||||
|
|
|
@ -9295,6 +9295,7 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||||
BuildVehicle(): 12
|
BuildVehicle(): 12
|
||||||
IsValidVehicle(12): true
|
IsValidVehicle(12): true
|
||||||
CloneVehicle(): 13
|
CloneVehicle(): 13
|
||||||
|
BuildVehicle(): 1048575
|
||||||
--Accounting--
|
--Accounting--
|
||||||
GetCosts(): 11894
|
GetCosts(): 11894
|
||||||
Should be: 11894
|
Should be: 11894
|
||||||
|
|
|
@ -333,6 +333,9 @@ bool ScriptObject::ScriptDoCommandHelper<Tcmd, Tret(*)(DoCommandFlag, Targs...)>
|
||||||
tile = std::get<0>(args);
|
tile = std::get<0>(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Do not even think about executing out-of-bounds tile-commands. */
|
||||||
|
if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (GetCommandFlags<Tcmd>() & CMD_ALL_TILES) == 0))) return false;
|
||||||
|
|
||||||
/* Only set ClientID parameters when the command does not come from the network. */
|
/* Only set ClientID parameters when the command does not come from the network. */
|
||||||
if constexpr ((::GetCommandFlags<Tcmd>() & CMD_CLIENT_ID) != 0) ScriptObjectInternal::SetClientIds(args, std::index_sequence_for<Targs...>{});
|
if constexpr ((::GetCommandFlags<Tcmd>() & CMD_CLIENT_ID) != 0) ScriptObjectInternal::SetClientIds(args, std::index_sequence_for<Targs...>{});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue