summaryrefslogtreecommitdiff
path: root/src/script/api/script_object.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-29 11:21:38 +0200
committerGitHub <noreply@github.com>2021-05-29 11:21:38 +0200
commitca9a7df7522a614b839a83e1ba9b6a7b08642b8a (patch)
tree172dedad1d930ef7699838272e779c9d7218319b /src/script/api/script_object.cpp
parent4d74e519074bec9a07c2997715ab635ac0e8f084 (diff)
downloadopenttd-ca9a7df7522a614b839a83e1ba9b6a7b08642b8a.tar.xz
Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not returns yes/no.
Diffstat (limited to 'src/script/api/script_object.cpp')
-rw-r--r--src/script/api/script_object.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp
index 85a85cca1..1f72eaa22 100644
--- a/src/script/api/script_object.cpp
+++ b/src/script/api/script_object.cpp
@@ -283,7 +283,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
{
char buffer[64];
::GetString(buffer, string, lastof(buffer));
- ::str_validate(buffer, lastof(buffer), SVS_NONE);
+ ::StrMakeValidInPlace(buffer, lastof(buffer), SVS_NONE);
return ::stredup(buffer);
}
@@ -312,7 +312,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
if (!StrEmpty(text) && (GetCommandFlags(cmd) & CMD_STR_CTRL) == 0) {
/* The string must be valid, i.e. not contain special codes. Since some
* can be made with GSText, make sure the control codes are removed. */
- ::str_validate(const_cast<char *>(text), text + strlen(text), SVS_NONE);
+ ::StrMakeValidInPlace(text, SVS_NONE);
}
/* Set the default callback to return a true/false result of the DoCommand */