mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use SQInteger for generic numbers in script_subsidy
parent
cd80b31d19
commit
07b73a8c02
|
@ -31,7 +31,7 @@
|
||||||
return ::Subsidy::Get(subsidy_id)->IsAwarded();
|
return ::Subsidy::Get(subsidy_id)->IsAwarded();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ bool ScriptSubsidy::Create(CargoID cargo_type, SubsidyParticipantType from_type, uint16 from_id, SubsidyParticipantType to_type, uint16 to_id)
|
/* static */ bool ScriptSubsidy::Create(CargoID cargo_type, SubsidyParticipantType from_type, SQInteger from_id, SubsidyParticipantType to_type, SQInteger to_id)
|
||||||
{
|
{
|
||||||
EnforcePrecondition(false, ScriptCargo::IsValidCargo(cargo_type));
|
EnforcePrecondition(false, ScriptCargo::IsValidCargo(cargo_type));
|
||||||
EnforcePrecondition(false, from_type == SPT_INDUSTRY || from_type == SPT_TOWN);
|
EnforcePrecondition(false, from_type == SPT_INDUSTRY || from_type == SPT_TOWN);
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
return (SubsidyParticipantType)(uint)::Subsidy::Get(subsidy_id)->src_type;
|
return (SubsidyParticipantType)(uint)::Subsidy::Get(subsidy_id)->src_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ int32 ScriptSubsidy::GetSourceIndex(SubsidyID subsidy_id)
|
/* static */ SQInteger ScriptSubsidy::GetSourceIndex(SubsidyID subsidy_id)
|
||||||
{
|
{
|
||||||
if (!IsValidSubsidy(subsidy_id)) return INVALID_SOURCE;
|
if (!IsValidSubsidy(subsidy_id)) return INVALID_SOURCE;
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
return (SubsidyParticipantType)(uint)::Subsidy::Get(subsidy_id)->dst_type;
|
return (SubsidyParticipantType)(uint)::Subsidy::Get(subsidy_id)->dst_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ int32 ScriptSubsidy::GetDestinationIndex(SubsidyID subsidy_id)
|
/* static */ SQInteger ScriptSubsidy::GetDestinationIndex(SubsidyID subsidy_id)
|
||||||
{
|
{
|
||||||
if (!IsValidSubsidy(subsidy_id)) return INVALID_SOURCE;
|
if (!IsValidSubsidy(subsidy_id)) return INVALID_SOURCE;
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
* @pre (to_type == SPT_INDUSTRY && ScriptIndustry::IsValidIndustry(to_id)) || (to_type == SPT_TOWN && ScriptTown::IsValidTown(to_id))
|
* @pre (to_type == SPT_INDUSTRY && ScriptIndustry::IsValidIndustry(to_id)) || (to_type == SPT_TOWN && ScriptTown::IsValidTown(to_id))
|
||||||
* @api -ai
|
* @api -ai
|
||||||
*/
|
*/
|
||||||
static bool Create(CargoID cargo_type, SubsidyParticipantType from_type, uint16 from_id, SubsidyParticipantType to_type, uint16 to_id);
|
static bool Create(CargoID cargo_type, SubsidyParticipantType from_type, SQInteger from_id, SubsidyParticipantType to_type, SQInteger to_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the company index of the company this subsidy is awarded to.
|
* Get the company index of the company this subsidy is awarded to.
|
||||||
|
@ -109,7 +109,7 @@ public:
|
||||||
* @pre IsValidSubsidy(subsidy_id).
|
* @pre IsValidSubsidy(subsidy_id).
|
||||||
* @return One of TownID/IndustryID.
|
* @return One of TownID/IndustryID.
|
||||||
*/
|
*/
|
||||||
static int32 GetSourceIndex(SubsidyID subsidy_id);
|
static SQInteger GetSourceIndex(SubsidyID subsidy_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the type of destination of subsidy.
|
* Returns the type of destination of subsidy.
|
||||||
|
@ -127,7 +127,7 @@ public:
|
||||||
* @pre IsValidSubsidy(subsidy_id).
|
* @pre IsValidSubsidy(subsidy_id).
|
||||||
* @return One of TownID/IndustryID.
|
* @return One of TownID/IndustryID.
|
||||||
*/
|
*/
|
||||||
static int32 GetDestinationIndex(SubsidyID subsidy_id);
|
static SQInteger GetDestinationIndex(SubsidyID subsidy_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SCRIPT_SUBSIDY_HPP */
|
#endif /* SCRIPT_SUBSIDY_HPP */
|
||||||
|
|
Loading…
Reference in New Issue