diff --git a/CHANGELOG.md b/CHANGELOG.md index 411d53f3e..4876cd53f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor): * Added extra argument for SetAmbientTrack() function to specify if new ambient track should play from the beginning. * Use load camera instead of load screen by playing fixed camera from OnEnd() event and removing loadScreenFile field from level's gameflow entry. * Fixed DisplayString class not supporting some Unicode characters and empty lines in multiline strings. +* Fixed DisplayString not being deallocated after showing. * Fixed incorrect behaviour of Moveable:GetJointRotation() function. * Fixed incorrect behaviour of Logic.EnableEvent() and Logic.DisableEvent() functions. * Fixed Util.HasLineOfSight() not taking static meshes into consideration. diff --git a/TombEngine/Scripting/Internal/TEN/Strings/StringsHandler.cpp b/TombEngine/Scripting/Internal/TEN/Strings/StringsHandler.cpp index 8e87c312c..22ecca1d7 100644 --- a/TombEngine/Scripting/Internal/TEN/Strings/StringsHandler.cpp +++ b/TombEngine/Scripting/Internal/TEN/Strings/StringsHandler.cpp @@ -30,7 +30,7 @@ Default: nil (i.e. infinite) @tparam bool autoDelete should be string automatically deleted after timeout is reached. If not given, the string will remain allocated even after timeout is reached, and can be shown again without re-initialization. -Default: false +Default: true */ table.set_function(ScriptReserved_ShowString, &StringsHandler::ShowString, this); @@ -93,7 +93,7 @@ void StringsHandler::ShowString(const DisplayString& str, sol::optional n auto it = m_userDisplayStrings.find(str.GetID()); it->second._timeRemaining = numSeconds.value_or(0.0f); it->second._isInfinite = !numSeconds.has_value(); - it->second._deleteWhenZero = autoDelete.value_or(false); + it->second._deleteWhenZero = autoDelete.value_or(true); } bool StringsHandler::IsStringDisplaying(const DisplayString& displayString)