From dec54458809ae15368093fe0746df75bcfd466ef Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 23 Jan 2013 19:36:44 +0000 Subject: [PATCH] Rework hardcoded BADGUY sprite flag initialization (i.e. amend r3257). Use a new flag to mark hard-coded enemies, not SPRITE_BADGUY. This fixes an issue where in E1L4, a pigcop would appear in the area you have to crawl under shrunk. Thanks to LLCoolDave1 for pinpointing the range of relevant revisions. git-svn-id: https://svn.eduke32.com/eduke32@3426 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 3 +++ polymer/eduke32/source/actors.h | 1 + polymer/eduke32/source/game.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index fb68b882d..13bfefa60 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -8151,6 +8151,9 @@ void A_PlayAlertSound(int32_t i) int32_t A_CheckEnemyTile(int32_t pn) { + if (g_tile[pn].flags & SPRITE_HARDCODED_BADGUY) + return 1; + return A_CheckSpriteTileFlags(pn, SPRITE_BADGUY); } diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index b8fffa13d..b0f8e413f 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -212,6 +212,7 @@ enum sflags_t { // rotation-fixed wrt a pivot point to prevent position diverging due to // roundoff error accumulation: SPRITE_ROTFIXED = 0x00020000, + SPRITE_HARDCODED_BADGUY = 0x00040000, }; // custom projectiles diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index d1031407d..f420a5a5d 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -9673,7 +9673,7 @@ static void G_LoadExtraPalettes(void) kclose(fp); } -#define SETBGFLAG(Tilenum) g_tile[Tilenum].flags |= SPRITE_BADGUY +#define SETBGFLAG(Tilenum) g_tile[Tilenum].flags |= SPRITE_HARDCODED_BADGUY // Has to be after setting the dynamic names (e.g. SHARK). static void A_InitEnemyFlags(void)