1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

Codechange: make the StringIndex (within a StringTab) a strong type

This commit is contained in:
Rubidium
2025-01-02 09:03:38 +01:00
committed by rubidium42
parent 2d372fa516
commit fd7a883cbd
10 changed files with 44 additions and 37 deletions

View File

@@ -33,7 +33,7 @@ ScriptText::ScriptText(HSQUIRRELVM vm)
if (SQ_FAILED(sq_getinteger(vm, 2, &sqstring))) {
throw sq_throwerror(vm, "First argument must be a valid StringID");
}
this->string = sqstring;
this->string = StringIndexInTab(sqstring);
/* The rest of the parameters must be arguments. */
for (int i = 0; i < nparam - 1; i++) {
@@ -185,7 +185,7 @@ void ScriptText::_FillParamList(ParamList &params, ScriptTextList &seen_texts)
static Param dummy = 0;
int nb_extra = SCRIPT_TEXT_MAX_PARAMETERS - (int)params.size();
for (int i = 0; i < nb_extra; i++)
params.emplace_back(-1, i, &dummy);
params.emplace_back(StringIndexInTab(-1), i, &dummy);
}
}