Issue974

Title Draining bots does not work
Priority 0.16 rc bugs Status rejected
Assigned To Keywords
Linked issues Watchers

Submitted on 2021-10-19 18h46 by cypherpunks, last changed by cypherpunks.

Messages
Author: cypherpunks Date: 2021-10-19   18h45
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
}
Author: cypherpunks Date: 2021-10-19   18h47
Sorry, duplicate. Issue 970.
History
Date User Action Args
2021-10-19 18:47:06cypherpunkssetstatus: open -> rejected
messages: + msg3712
2021-10-19 18:46:00cypherpunkscreate