From 9bae1b9e25b25981dc2c6e2b4f80c671c2da105d Mon Sep 17 00:00:00 2001 From: Joao Pasqualini Costa Date: Tue, 9 Apr 2013 17:54:57 -0300 Subject: [PATCH 1/2] Fix #316 It still have a bug when using string like this: " teste {{}} teste" --- modules/game_console/console.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 0bd8643c..82d485c8 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -466,7 +466,7 @@ function addTabText(text, speaktype, tab, creatureName) -- Remove the curly braces for i = 1, #highlightData / 3 do local dataBlock = { _start = highlightData[(i-1)*3+1], _end = highlightData[(i-1)*3+2], words = highlightData[(i-1)*3+3] } - text = text:gsub("{"..dataBlock.words.."}", dataBlock.words) + text = text:gsub("%{(.-)%}", dataBlock.words, 1) -- Recalculate positions as braces are removed highlightData[(i-1)*3+1] = dataBlock._start - ((i-1) * 2) From 57bb6ff974b8787db4a78ad85038cefed7526c1e Mon Sep 17 00:00:00 2001 From: Joao Pasqualini Costa Date: Tue, 9 Apr 2013 18:02:43 -0300 Subject: [PATCH 2/2] Fix #315 by @pacmanis Credits go to @pacmanis --- src/client/tile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/tile.cpp b/src/client/tile.cpp index bac2fa31..af10c38f 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -449,14 +449,14 @@ ThingPtr Tile::getTopMultiUseThing() if(isEmpty()) return nullptr; - if(CreaturePtr topCreature = getTopCreature()) - return topCreature; - for(uint i = 0; i < m_things.size(); ++i) { ThingPtr thing = m_things[i]; if(thing->isForceUse()) return thing; } + + if(CreaturePtr topCreature = getTopCreature()) + return topCreature; for(uint i = 0; i < m_things.size(); ++i) { ThingPtr thing = m_things[i];