From 78b841d14e35e06b071d2fc16550b4b4cd010549 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 9 Sep 2023 16:36:46 +0100 Subject: [PATCH] Codechange: Take reference to text effect instead of pointer when updating. --- src/texteff.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/texteff.cpp b/src/texteff.cpp index a7cd3cdf04..98a7e85794 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -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()