From 067baf626ae5d2ebd792f6e1da6ad25d7ba043bb Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 24 Oct 2012 13:21:02 +0000 Subject: [PATCH] Comment out the A_GetZLimits() call right before the Bassert() in A_MoveSprite(). This call is a problem because the assertion expects "dasectnum" and spr->sectnum to match, but A_GetZLimits() can itself call A_SetSprite() which results in another call to A_MoveSprite() and can potentially change the sectnum again. This commit also adds the NOTELEPORT sprite flag, which of course prevents sprites from teleporting. git-svn-id: https://svn.eduke32.com/eduke32@3094 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 10 +++++++--- polymer/eduke32/source/actors.h | 28 +++++++++++++++------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index dba1300bd..05f927ad0 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -399,7 +399,7 @@ int32_t A_MoveSprite(int32_t spritenum, const vec3_t *change, uint32_t cliptype) else if (dasectnum != spr->sectnum) { changespritesect(spritenum, dasectnum); - A_GetZLimits(spritenum); + // A_GetZLimits(spritenum); } Bassert(dasectnum == spr->sectnum); @@ -3220,8 +3220,12 @@ static void P_FinishWaterChange(int32_t j, DukePlayer_t *ps, int32_t sectlotag, } } -static int32_t A_CheckNonTeleporting(int32_t pic) +static int32_t A_CheckNonTeleporting(int32_t s) { + int32_t pic = sprite[s].picnum; + + if (A_CheckSpriteFlags(s, SPRITE_NOTELEPORT)) return 1; + return (pic == SHARK || pic == COMMANDER || pic == OCTABRAIN || (pic >= GREENSLIME && pic <= GREENSLIME+7)); } @@ -3355,7 +3359,7 @@ ACTOR_STATIC void G_MoveTransports(void) // comment out to make RPGs pass through water: (r1450 breaks this) // if (sectlotag != 0) goto JBOLT; case STAT_ACTOR: - if (sprite[j].extra > 0 && A_CheckNonTeleporting(sprite[j].picnum)) + if (sprite[j].extra > 0 && A_CheckNonTeleporting(j)) goto JBOLT; case STAT_MISC: case STAT_FALLER: diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index eb33f38bb..1cbb2e984 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -168,19 +168,21 @@ typedef struct { #pragma pack(pop) enum sflags_t { - SPRITE_SHADOW = 0x00000001, - SPRITE_NVG = 0x00000002, - SPRITE_NOSHADE = 0x00000004, - SPRITE_PROJECTILE = 0x00000008, - SPRITE_DECAL = 0x00000010, - SPRITE_BADGUY = 0x00000020, - SPRITE_NOPAL = 0x00000040, - SPRITE_NOEVENTCODE = 0x00000080, - SPRITE_NOLIGHT = 0x00000100, - SPRITE_USEACTIVATOR = 0x00000200, - SPRITE_NULL = 0x00000400, // null sprite in multiplayer - SPRITE_NOCLIP = 0x00000800, // clipmove it with cliptype 0 - SPRITE_NOFLOORSHADOW= 0x00001000, // for temp. internal use, per-tile flag not checked + SPRITE_SHADOW = 0x00000001, + SPRITE_NVG = 0x00000002, + SPRITE_NOSHADE = 0x00000004, + SPRITE_PROJECTILE = 0x00000008, + SPRITE_DECAL = 0x00000010, + SPRITE_BADGUY = 0x00000020, + SPRITE_NOPAL = 0x00000040, + SPRITE_NOEVENTCODE = 0x00000080, + SPRITE_NOLIGHT = 0x00000100, + SPRITE_USEACTIVATOR = 0x00000200, + SPRITE_NULL = 0x00000400, // null sprite in multiplayer + SPRITE_NOCLIP = 0x00000800, // clipmove it with cliptype 0 + SPRITE_NOFLOORSHADOW = 0x00001000, // for temp. internal use, per-tile flag not checked + SPRITE_SMOOTHMOVE = 0x00002000, + SPRITE_NOTELEPORT = 0x00004000, }; // custom projectiles