If Tux attempts to drain a bot and has less than 100% health, nothing happens, and the following error appears in the terminal:
FreedroidRPG 1.0rc2-25-gf4f18ecde encountered a problem in function: resume_lua_coroutine
Error running Lua code: ../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
}
|