From 57dc7d20b65fc3ca6f17b25e4ebfeb6693700fd0 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Thu, 10 Jan 2013 07:46:32 -0600 Subject: [PATCH 1/2] Fix for Ignore Private ignoring NPCs Ignore Private message setting was ignoring NPC chat in the NPC window. --- 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 8b2985cf..7762d30c 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -612,7 +612,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos) speaktype = SpeakTypes[mode] if ((mode == MessageModes.Yell and isIgnoringYelling()) or - (speaktype.private and isIgnoringPrivate()) or + (speaktype.private and isIgnoringPrivate() and mode ~= MessageModes.NpcFrom) or (isIgnored(name) or isIgnored(name:lower()))) and name ~= g_game.getLocalPlayer():getName() then return From 47d5e1d5e63b8b716c3c265cb2e0a65d0dc7eede Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Sun, 13 Jan 2013 20:02:00 -0600 Subject: [PATCH 2/2] Fix for battle list sorting All creatures were being removed and re-added, only add ones we don't have, and then remove ones we shouldn't have. --- modules/game_battle/battle.lua | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/game_battle/battle.lua b/modules/game_battle/battle.lua index 47a24af9..6d46b183 100644 --- a/modules/game_battle/battle.lua +++ b/modules/game_battle/battle.lua @@ -97,21 +97,26 @@ function onMiniWindowClose() end function checkCreatures() - removeAllCreatures() - - local spectators = {} local player = g_game.getLocalPlayer() if g_game.isOnline() then creatures = g_map.getSpectators(player:getPosition(), false) for i, creature in ipairs(creatures) do if creature ~= player and doCreatureFitFilters(creature) then - table.insert(spectators, creature) + if not hasCreature(creature) then + addCreature(creature) + end end end - end - - for i, v in pairs(spectators) do - addCreature(v) + local toRemove = {} + for i, b in pairs(battleButtonsByCreaturesList) do + if (not table.contains(creatures, b.creature)) or (not doCreatureFitFilters(b.creature)) then + table.insert(toRemove, b.creature) + end + end + + for i, creature in pairs(toRemove) do + removeCreature(creature) + end end end