Page 1 of 1

[git] Arithmetic LUA errors

Posted: Fri Jul 26, 2013 3:40 am
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]

Re: [git] Arithmetic LUA errors

Posted: Fri Jul 26, 2013 7:24 am
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.

Re: [git] Arithmetic LUA errors

Posted: Fri Jul 26, 2013 5:51 pm
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

Re: [git] Arithmetic LUA errors

Posted: Fri Jul 26, 2013 6:13 pm
by darkgod
It was already fixed

Re: [git] Arithmetic LUA errors

Posted: Sat Jul 27, 2013 7:12 am
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.

Re: [git] Arithmetic LUA errors

Posted: Sat Jul 27, 2013 10:21 am
by darkgod
I get them but you can post them too for more clarity

Re: [git] Arithmetic LUA errors

Posted: Sat Jul 27, 2013 8:48 pm
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.