diff --git a/polymer/eduke32/source/lunatic/control.lua b/polymer/eduke32/source/lunatic/control.lua index c092cb508..3adb61ae0 100644 --- a/polymer/eduke32/source/lunatic/control.lua +++ b/polymer/eduke32/source/lunatic/control.lua @@ -1696,17 +1696,15 @@ function _G_OperateRespawns(tag) local spr = sprite[i] if (spr.lotag==tag and ispic(spr.picnum, "RESPAWN")) then - if (ffiC.ud.monsters_off~=0 and isenemytile(spr.hitag)) then - return - end + if (ffiC.ud.monsters_off==0 or not isenemytile(spr.hitag)) then + if (D.TRANSPORTERSTAR) then + local j = spawn(D.TRANSPORTERSTAR, i) + sprite[j].z = sprite[j].z - (32*256) + end - if (D.TRANSPORTERSTAR) then - local j = spawn(D.TRANSPORTERSTAR, i) - sprite[j].z = sprite[j].z - (32*256) + -- Just a way to killit (see G_MoveFX(): RESPAWN__STATIC) + spr.extra = 66-12 end - - -- Just a way to killit (see G_MoveFX(): RESPAWN__STATIC) - spr.extra = 66-12 end end end diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index d097b6838..7d381c93e 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -971,21 +971,23 @@ REDODOOR: void G_OperateRespawns(int32_t low) { - int32_t j, nexti, i = headspritestat[STAT_FX]; + int32_t i, nexti; - while (i >= 0) + for (SPRITES_OF_STAT_SAFE(STAT_FX, i, nexti)) { - nexti = nextspritestat[i]; - if ((SLT == low) && (PN == RESPAWN)) + spritetype *respr = &sprite[i]; + + if (respr->lotag == low && respr->picnum == RESPAWN) { - if (A_CheckEnemyTile(SHT) && ud.monsters_off) break; + if (!ud.monsters_off || !A_CheckEnemyTile(respr->hitag)) + { + int32_t j = A_Spawn(i, TRANSPORTERSTAR); + sprite[j].z -= (32<<8); - j = A_Spawn(i,TRANSPORTERSTAR); - sprite[j].z -= (32<<8); - - sprite[i].extra = 66-12; // Just a way to killit + // Just a way to killit (see G_MoveFX(): RESPAWN__STATIC) + respr->extra = 66-12; + } } - i = nexti; } }