[git] Arithmetic LUA errors

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
grmblfzzz
Thalore
Posts: 133
Joined: Fri Nov 25, 2011 7:53 pm

[git] Arithmetic LUA errors

#1 Post by grmblfzzz »

This error occurs pretty frequently from random mobs trying to do stuff anywhere on the level. Haven't managed to isolate exactly what talent or whatnot is causing it, if this isn't enough info can investigate more closely next time it crops up.

[URL=http://s1302.photobucket.com/user/ ... .png[/img][/url]

0player
Uruivellas
Posts: 717
Joined: Fri May 24, 2013 4:27 pm

Re: [git] Arithmetic LUA errors

#2 Post by 0player »

The line causing annoyance is:

Code: Select all

if ab.stamina and self:getStamina() < util.getval(ab.stamina, self, ab) * (100 + self:combatFatigue()) / 100 and (not self:hasEffect(self.EFF_ADRENALINE_SURGE) or self.life < ab.stamina * (100 + self:combatFatigue()) / 100) then
The expression "ab.stamina * (100 + self:combatFatigue)/100)" should be replaced with "util.getval(ab.stamina, self, ab) * (100 + self:combatFatigue()) / 100", like in former comparison.
It triggers only on variable-stamina talents when Adrenaline Surge is active. So, rarely.

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

Re: [git] Arithmetic LUA errors

#3 Post by Hachem_Muche »

Good Catch!

Here is the patch for the latest Git version (e6f53c639a11490b6525635fafa890e6c67088f6)

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 e6f5082..ca59174 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -3613,7 +3613,7 @@ function _M:preUseTalent(ab, silent, fake)
 			if not silent then game.logPlayer(self, "You do not have enough mana to cast %s.", ab.name) end
 			return false
 		end
-		if ab.stamina and self:getStamina() < util.getval(ab.stamina, self, ab) * (100 + self:combatFatigue()) / 100 and (not self:hasEffect(self.EFF_ADRENALINE_SURGE) or self.life < ab.stamina * (100 + self:combatFatigue()) / 100) then
+		if ab.stamina and self:getStamina() < util.getval(ab.stamina, self, ab) * (100 + self:combatFatigue()) / 100 and (not self:hasEffect(self.EFF_ADRENALINE_SURGE) or self.life < util.getval(ab.stamina, self, ab) * (100 + self:combatFatigue()) / 100) then
 			if not silent then game.logPlayer(self, "You do not have enough stamina to use %s.", ab.name) end
 			return false
 		end
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

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

Re: [git] Arithmetic LUA errors

#4 Post by darkgod »

It was already fixed
[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 ;)

grmblfzzz
Thalore
Posts: 133
Joined: Fri Nov 25, 2011 7:53 pm

Re: [git] Arithmetic LUA errors

#5 Post by grmblfzzz »

Hmm, I guess I should be better about regularly updating my version to keep track of these things. A general question, out of curiosity: Random non-destructive LUA errors that crop up like this, I tend to write a little description and send a report the first time they come along. Are these usually just quietly dealt with, and it'd be best not to spam up the bug forum with them?

For instance, there's another one (which I guess may or may not have been stealthily dealt with!) where you get an LUA error when trying to use shoot down on a Tornado projectile.

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

Re: [git] Arithmetic LUA errors

#6 Post by darkgod »

I get them but you can post them too for more clarity
[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 ;)

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

Re: [git] Arithmetic LUA errors

#7 Post by Hachem_Muche »

I was using the latest Git files so I have no idea how the correction (which predates the switch to git) failed to get into my repo.

At any rate, the rule of thumb I use when deciding to post a bug on the forums is if the post would be useful documentation for players. So generally, I'll post in the forums about a bug on the current official release.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Post Reply