[svn 5720] monsters attack repeatedly while lua errors

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

[svn 5720] monsters attack repeatedly while lua errors

#1 Post by greycat »

After entering Trollmire(3) I started getting Lua errors during almost every fight. Even after leaving Trollmire and going on to Zigur. I "reported" some of them at random. There were many, many, many, many more.

In some cases, a monster decided it would be cool to attack me repeatedly while I sit there helplessly. I did not get to do anything while this occurred, but apparently some tiny fraction of my retaliation damage seemed to hit the monster (I should have had WAY more). This happened at least twice, with the first monster dying to the retaliation. Here is the second one:

[LOG] Vog hits dread for #aaaaaa#8 physical#LAST#, #aaaaaa#8 physical#LAST#, #aaaaaa#8 physical#LAST#, #aaaaaa#8 physical#LAST#, #aaaaaa#8 physical#LAST#, #aaaaaa#8 physical#LAST#, #aaaaaa#8 physical#LAST# damage (total 54.60).
[LOG] Dread hits Vog for #aaaaaa#40 physical#LAST#, #aaaaaa#42 physical#LAST#, #aaaaaa#40 physical#LAST#, #aaaaaa#40 physical#LAST#, #aaaaaa#43 physical#LAST#, #aaaaaa#40 physical#LAST#, #aaaaaa#40 physical#LAST# damage (total 283.57).
[LOG] #{bold}#Dread killed Vog!#{normal}#
[LOG] #{bold}#Vog the level 12 dwarf wyrmic was battered to death by a dread on level 1 of Zigur.#{normal}#

Sradac
Sher'Tul
Posts: 1081
Joined: Fri Sep 21, 2007 3:18 am
Location: Angolwen

Re: [svn 5720] monsters attack repeatedly while lua errors

#2 Post by Sradac »

This is happening to me as well.

By chance, what class are you? I was playing solipsist and I thought something with either feedback generation or damage psi instead of health was broken.

edit - nm, just saw dwarf wyrmic.

Un67
Higher
Posts: 45
Joined: Mon Sep 03, 2012 6:07 pm

Re: [svn 5720] monsters attack repeatedly while lua errors

#3 Post by Un67 »

Something like this also happened to me in the Heart of the Gloom with a Dwarf Corruptor as I fought the Withering Thing. There was at least one error each turn, sometimes just when I was resting in the area near where it was (of course I didn't know that at the time). I ended up getting killed by it at the end and there must have been at least maybe 20 or so error windows that popped up when that happened.

Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Re: [svn 5720] monsters attack repeatedly while lua errors

#4 Post by Noel »

Yeah, I just got lua-error'ed to death by this as well.

I think I've found the bug. svn 5717 ("fix meditation exp range") changed modules/tome/class/interface/Combat.lua, line 622:

Code: Select all

 	if hitted then for typ, dam in pairs(target.on_melee_hit) do
-		if dam > 0 then
+		if (type(dam) == "number" and dam > 0) or (dam.dam and dam.dam > 0) then
 			DamageType:get(typ).projector(target, self.x, self.y, typ, dam)
 		end
 	end end
If dam is a number and < 0, the first condition fails, and it tries to access dam.dam, which fails since dam is a number.

Should have something like this, separating the extraction of numeric damage from the actual condition. (This patch seems to work for me.)

Code: Select all

diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/cl
index 6a5a3bb..50280cd 100644
--- a/game/modules/tome/class/interface/Combat.lua
+++ b/game/modules/tome/class/interface/Combat.lua
@@ -619,7 +619,8 @@ function _M:attackTargetWith(target, weapon, damtype, mult, 
 
        -- Reactive target on hit damage
        if hitted then for typ, dam in pairs(target.on_melee_hit) do
-               if (type(dam) == "number" and dam > 0) or (dam.dam and dam.dam > 0) then
+               local mydam = type(dam) == "number" and dam or dam.dam
+               if (mydam > 0) then
                        DamageType:get(typ).projector(target, self.x, self.y, ty
                end
        end end

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [svn 5720] monsters attack repeatedly while lua errors

#5 Post by darkgod »

fixed thanks
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply