(svn r23777) -Codechange: refactor allocating memory and fetching strings into a single function for scripts

This commit is contained in:
rubidium
2012-01-08 21:48:05 +00:00
parent ab38e3227d
commit 4479f90843
14 changed files with 27 additions and 60 deletions

View File

@@ -48,13 +48,8 @@
{
if (!IsValidSign(sign_id)) return NULL;
static const int len = 64;
char *sign_name = MallocT<char>(len);
::SetDParam(0, sign_id);
::GetString(sign_name, STR_SIGN_NAME, &sign_name[len - 1]);
return sign_name;
return GetString(STR_SIGN_NAME);
}
/* static */ TileIndex ScriptSign::GetLocation(SignID sign_id)