Codechange: Take reference to text effect instead of pointer when updating.

This commit is contained in:
Peter Nelson 2023-09-09 16:36:46 +01:00 committed by PeterN
parent 7519f7ad79
commit 78b841d14e
1 changed files with 5 additions and 5 deletions

View File

@ -63,12 +63,12 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8_t duration, Te
void UpdateTextEffect(TextEffectID te_id, StringID msg)
{
/* Update details */
TextEffect *te = _text_effects.data() + te_id;
if (msg == te->string_id && !HaveDParamChanged(te->params)) return;
te->string_id = msg;
CopyOutDParam(te->params, 2);
TextEffect &te = _text_effects[te_id];
if (msg == te.string_id && !HaveDParamChanged(te.params)) return;
te.string_id = msg;
CopyOutDParam(te.params, 2);
te->UpdatePosition(te->center, te->top, te->string_id, te->string_id - 1);
te.UpdatePosition(te.center, te.top, te.string_id, te.string_id - 1);
}
void UpdateAllTextEffectVirtCoords()