Issue961

Title Problem in FDnpc.drain_health
Priority bug Status open
Assigned To Keywords
Linked issues Watchers

Submitted on 2019-11-08 10h24 by bircoph, last changed by jesusalva.

Messages
Author: bircoph Date: 2019-11-08   10h24
Hi!

I play freedroidRPG-1.0rc2 configured with embedded lua. I repeatedly receive the following error:

---------------------------------------------------------------------------------
FreedroidRPG 1.0RC2 encountered a problem in function: resume_lua_coroutine
Error running Lua code: /usr/share/freedroidrpg/lua_modules/FDnpc_lfuns.lua:82: bad argument #1 to 'hurt' (number has no integer representation).
Erroneous LuaCode={
76  function FDnpc.drain_health(self)
77      --[[ For example, if NPC's health = 10, hurt_tux(-10) will heal tux by 10 HP
78           To have the difficulty lvl influence the HP tux gets we divide the
79           HP by the difficulty_lvl+1 (to prevent division by zero)
80           -10/2 (difficulty_lvl = 3/hard) = -5.  Tux will be healed by 5 HP ]]--
81      local tux = FDrpg.get_tux()
>82     tux:hurt(-(self:get_health())/(difficulty_level()+1))
83      self:drop_dead()
84  end
}


If you encounter this message, please inform the FreedroidRPG developers about it!
You can
  send an e-mail to                    freedroid-discussion AT lists.sourceforge.net
  mention it on our IRC channel        #freedroid on irc.freenode.net
  or report the bug on our tracker at  http://bugs.freedroid.org/

Thank you!
---------------------------------------------------------------------------------

The game continues to work fine, at least no visible problems except these messages.
Author: jesusalva Date: 2019-11-11   01h15
fluzz do you believe this could be a bug 
involving floating pointers?
History
Date User Action Args
2019-11-11 01:15:09jesusalvasetmessages: + msg3664
2019-11-08 10:24:08bircophcreate