mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: Use SQInteger for generic numbers in script_group
This commit is contained in:
parent
6ca8499e6a
commit
8eb35633ec
|
@ -102,14 +102,14 @@
|
|||
return HasBit(::Group::Get(group_id)->flags, GroupFlags::GF_REPLACE_PROTECTION);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptGroup::GetNumEngines(GroupID group_id, EngineID engine_id)
|
||||
/* static */ SQInteger ScriptGroup::GetNumEngines(GroupID group_id, EngineID engine_id)
|
||||
{
|
||||
if (!IsValidGroup(group_id) && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return -1;
|
||||
|
||||
return GetGroupNumEngines(ScriptObject::GetCompany(), group_id, engine_id);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptGroup::GetNumVehicles(GroupID group_id, ScriptVehicle::VehicleType vehicle_type)
|
||||
/* static */ SQInteger ScriptGroup::GetNumVehicles(GroupID group_id, ScriptVehicle::VehicleType vehicle_type)
|
||||
{
|
||||
bool valid_group = IsValidGroup(group_id);
|
||||
if (!valid_group && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return -1;
|
||||
|
@ -183,7 +183,7 @@
|
|||
return ::Group::Get(group_id)->statistics.profit_last_year;
|
||||
}
|
||||
|
||||
/* static */ uint32 ScriptGroup::GetCurrentUsage(GroupID group_id)
|
||||
/* static */ SQInteger ScriptGroup::GetCurrentUsage(GroupID group_id)
|
||||
{
|
||||
if (!IsValidGroup(group_id)) return -1;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
* @pre IsValidGroup(group_id) || group_id == GROUP_ALL || group_id == GROUP_DEFAULT.
|
||||
* @return The number of engines with id engine_id in the group with id group_id.
|
||||
*/
|
||||
static int32 GetNumEngines(GroupID group_id, EngineID engine_id);
|
||||
static SQInteger GetNumEngines(GroupID group_id, EngineID engine_id);
|
||||
|
||||
/**
|
||||
* Get the total number of vehicles in a given group and its sub-groups.
|
||||
|
@ -140,7 +140,7 @@ public:
|
|||
* vehicle_type is retrieved from the group itself and not from the input value.
|
||||
* But if the group is GROUP_ALL or GROUP_DEFAULT, then vehicle_type must be valid.
|
||||
*/
|
||||
static int32 GetNumVehicles(GroupID group_id, ScriptVehicle::VehicleType vehicle_type);
|
||||
static SQInteger GetNumVehicles(GroupID group_id, ScriptVehicle::VehicleType vehicle_type);
|
||||
|
||||
/**
|
||||
* Move a vehicle to a group.
|
||||
|
@ -225,7 +225,7 @@ public:
|
|||
* @pre IsValidGroup(group_id).
|
||||
* @return The current usage of the group.
|
||||
*/
|
||||
static uint32 GetCurrentUsage(GroupID group_id);
|
||||
static SQInteger GetCurrentUsage(GroupID group_id);
|
||||
|
||||
/**
|
||||
* Set primary colour for a group.
|
||||
|
|
Loading…
Reference in New Issue