Recycling an ucstring from i18n.get is not allowed, it's const, fix kaetemi/ryzomclassic#134

ryzomclassic-develop
kaetemi 4 years ago
parent 5056d3a72a
commit 357bb28ef2

@ -449,6 +449,7 @@ function r2.dialogs:updateElementEditor()
-- to who -- to who
local toWhoInst = r2:getInstanceFromId(tostring(instanceChat.Actions[0].Facing)) local toWhoInst = r2:getInstanceFromId(tostring(instanceChat.Actions[0].Facing))
if toWhoInst then if toWhoInst then
uc_chat = ucstring()
uc_chat:fromUtf8(toWhoInst.Name) uc_chat:fromUtf8(toWhoInst.Name)
else else
uc_chat = i18n.get("uiR2EdNobody") uc_chat = i18n.get("uiR2EdNobody")
@ -458,6 +459,7 @@ function r2.dialogs:updateElementEditor()
-- emote -- emote
local emoteName = self.fromEmoteIdToName[instanceChat.Actions[0].Emote] local emoteName = self.fromEmoteIdToName[instanceChat.Actions[0].Emote]
if emoteName then if emoteName then
uc_chat = ucstring()
uc_chat:fromUtf8(emoteName) uc_chat:fromUtf8(emoteName)
else else
uc_chat = i18n.get("uiR2EdNoElt") uc_chat = i18n.get("uiR2EdNoElt")
@ -469,8 +471,8 @@ function r2.dialogs:updateElementEditor()
uc_chat:fromUtf8(self.elementInitialName.." : ") uc_chat:fromUtf8(self.elementInitialName.." : ")
chatName.uc_hardtext = uc_chat chatName.uc_hardtext = uc_chat
minutesText.uc_hardtext = tostring(0) minutesText.uc_hardtext = "0"
secondsText.uc_hardtext = tostring(0) secondsText.uc_hardtext = "0"
whoMenuText.uc_hardtext = "" whoMenuText.uc_hardtext = ""

@ -598,9 +598,8 @@ function r2.ScenarioWindow:updateActProperties()
} }
local season = actGr:find("season_name") local season = actGr:find("season_name")
assert(season) assert(season)
local uc_season = ucstring()
local seasonStr = seasons[location.Season] local seasonStr = seasons[location.Season]
uc_season:fromUtf8(i18n.get(seasonStr):toUtf8()) local uc_season = i18n.get(seasonStr)
season.uc_hardtext = uc_season season.uc_hardtext = uc_season
-- manual weather -- manual weather

Loading…
Cancel
Save