Merge branch 'master' into jgrpp
# Conflicts: # src/script/api/script_company.cpp # src/script/api/script_date.cpp # src/script/api/script_date.hpp # src/script/api/script_gamesettings.cpp # src/script/api/script_order.hpp # src/script/api/script_town.cpp # src/script/api/script_window.cpp
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
return sd != nullptr && sd->IsIntSetting();
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptGameSettings::GetValue(const char *setting)
|
||||
/* static */ SQInteger ScriptGameSettings::GetValue(const char *setting)
|
||||
{
|
||||
if (!IsValid(setting)) return -1;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
return sd->AsIntSetting()->Read(&_settings_game);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptGameSettings::SetValue(const char *setting, int value)
|
||||
/* static */ bool ScriptGameSettings::SetValue(const char *setting, SQInteger value)
|
||||
{
|
||||
if (!IsValid(setting)) return false;
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
if ((sd->flags & SF_NO_NETWORK_SYNC) != 0) return false;
|
||||
|
||||
value = Clamp<SQInteger>(value, INT32_MIN, INT32_MAX);
|
||||
|
||||
return ScriptObject::DoCommand(0, 0, value, CMD_CHANGE_SETTING, sd->name);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user