Thunderstorm zaps after death

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
SageAcrin
Sher'Tul Godslayer
Posts: 1884
Joined: Tue Apr 10, 2012 6:52 pm

Thunderstorm zaps after death

#1 Post by SageAcrin »

This bug has been around...almost since I started playing, and I'm still not sure why it happens. It still happens in 1.04 though; Sometimes, for some reason, enemies will zap you with Thunderstorm after death.

However, in skimming the code, I happened to notice something; If you change...

Code: Select all

                 if self:isTalentActive(self.T_THUNDERSTORM) then
To...

Code: Select all

if not self.dead and if self:isTalentActive(self.T_THUNDERSTORM) then
...In Actor.lua, wouldn't that fix the problem no matter how it's happening?

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: Thunderstorm zaps after death

#2 Post by Hachem_Muche »

I think this bug is caused when a timed effect (poison, bleeding, etc) kills the actor while having the effect active. An extra check for death should indeed fix the problem, but moved to the wilderness check so that it catches all similar effects: Patch:

Code: Select all

 game/modules/tome/class/Actor.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index b465254..e314ac0 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -470,7 +470,7 @@ function _M:actBase()
 	self:timedEffects()
 
 	-- Handle thunderstorm, even if the actor is stunned or incapacitated it still works
-	if not game.zone.wilderness then
+	if not game.zone.wilderness and not self.dead then
 		if self:isTalentActive(self.T_THUNDERSTORM) then
 			local t = self:getTalentFromId(self.T_THUNDERSTORM)
 			t.do_storm(self, t)
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Post Reply