Fix respawn operation with monsters off, rewriting G_OperateRespawns().

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4276 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-01-29 18:32:51 +00:00
parent 63e0de5e3d
commit 1b3046d1c8
2 changed files with 19 additions and 19 deletions

View file

@ -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

View file

@ -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;
}
}