Merge branch 'master' into jgrpp

# Conflicts:
#	src/music.cpp
#	src/script/api/script_company.cpp
#	src/script/api/script_event_types.cpp
#	src/script/api/script_group.cpp
#	src/script/api/script_object.cpp
#	src/script/api/script_road.cpp
This commit is contained in:
Jonathan G Rennison
2023-03-11 00:06:13 +00:00
61 changed files with 844 additions and 52 deletions

View File

@@ -44,6 +44,7 @@
{
CCountedPtr<Text> counter(name);
EnforceDeityMode(false);
EnforcePrecondition(false, IsValidTown(town_id));
std::string text;
if (name != nullptr) {
@@ -58,6 +59,7 @@
{
CCountedPtr<Text> counter(text);
EnforceDeityMode(false);
EnforcePrecondition(false, IsValidTown(town_id));
return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id, 0, CMD_TOWN_SET_TEXT, text != nullptr ? text->GetEncodedText().c_str() : "");
@@ -125,6 +127,7 @@
/* static */ bool ScriptTown::SetCargoGoal(TownID town_id, ScriptCargo::TownEffect towneffect_id, SQInteger goal)
{
EnforceDeityMode(false);
EnforcePrecondition(false, IsValidTown(town_id));
EnforcePrecondition(false, ScriptCargo::IsValidTownEffect(towneffect_id));
@@ -155,6 +158,7 @@
/* static */ bool ScriptTown::SetGrowthRate(TownID town_id, SQInteger days_between_town_growth)
{
EnforceDeityMode(false);
EnforcePrecondition(false, IsValidTown(town_id));
uint16 growth_rate;
switch (days_between_town_growth) {
@@ -283,6 +287,7 @@
CCountedPtr<Text> counter(name);
EnforceDeityOrCompanyModeValid(false);
EnforcePrecondition(false, ScriptCompanyMode::IsDeity() || _settings_game.economy.found_town != TF_FORBIDDEN);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, size == TOWN_SIZE_SMALL || size == TOWN_SIZE_MEDIUM || size == TOWN_SIZE_LARGE)