diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index ab744cdea..f2f136db8 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -889,7 +889,8 @@ int32_t A_IncurDamage(int32_t sn) spritetype *const targ = &sprite[sn]; actor_t *const dmg = &actor[sn]; - if (dmg->extra < 0 || targ->extra < 0) + // dmg->picnum check: safety, since it might have been set to <0 from CON. + if (dmg->extra < 0 || targ->extra < 0 || dmg->picnum < 0) { dmg->extra = -1; return -1; @@ -1913,7 +1914,7 @@ ACTOR_STATIC void G_MoveStandables(void) if (s->picnum == FIREEXT) { - if (A_IncurDamage(i) == -1) + if (A_IncurDamage(i) < 0) goto BOLT; for (k=0; k<16; k++) diff --git a/polymer/eduke32/source/lunatic/control.lua b/polymer/eduke32/source/lunatic/control.lua index 21c3eb55c..dc6dc6af6 100644 --- a/polymer/eduke32/source/lunatic/control.lua +++ b/polymer/eduke32/source/lunatic/control.lua @@ -1014,7 +1014,7 @@ function _addphealth(ps, aci, hlthadd) local qmaxhlth = bit.rshift(ps.max_player_health, 2) if (j-hlthadd < qmaxhlth and j >= qmaxhlth) then -- XXX: DUKE_GOTHEALTHATLOW - _sound(229, aci) + _sound(aci, 229) end ps.last_extra = j diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index c796fb187..7440bfa79 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -917,7 +917,9 @@ local actor_mt = { end, set_picnum = function(a, picnum) - check_tile_idx(picnum) + if (picnum >= 0) then + check_tile_idx(picnum) + end ffi.cast(actor_ptr_ct, a).picnum = picnum end, diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index 3532ed52e..e37d296c8 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -1596,6 +1596,12 @@ end local function SetStructCmd(accessfunc, pattern) local function capfunc(idx, memb, var) local membercode, ismethod = accessfunc(true, idx, memb) +--[[ + local member = memb[1]:lower() + if (type(var)=="number" and var<0 and member:match("picnum")) then + warnprintf("member '.%s' is set to a negative value", member) + end +--]] if (ismethod) then -- METHOD_MEMBER syntax