From 57079dfee1e2506cc2f3290ed80d9170648e1edc Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 5 Feb 2015 16:30:14 +0000 Subject: [PATCH] Add SFLAG_NOWATERDIP, unconditionally preventing actors from dipping into ST1 water. By default, the following enemies have this flag set: OCTABRAIN, COMMANDER, DRONE. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4956 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.h | 1 + polymer/eduke32/source/game.c | 12 ++++++++---- polymer/eduke32/source/gamedef.c | 1 + polymer/eduke32/source/gameexec.c | 7 +------ polymer/eduke32/source/lunatic/con_lang.lua | 1 + 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index 1c07e099b..cf360824a 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -269,6 +269,7 @@ enum sflags_t { SFLAG_HARDCODED_BADGUY = 0x00040000, SFLAG_DIDNOSE7WATER = 0x00080000, // used temporarily SFLAG_NODAMAGEPUSH = 0x00100000, + SFLAG_NOWATERDIP = 0x00200000, }; // Custom projectiles "workslike" flags. diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 359cc6384..0da02a997 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -10784,16 +10784,20 @@ static void A_InitEnemyFlags(void) LIZMAN, LIZMANSPITTING, LIZMANJUMP, ORGANTIC, BOSS1, BOSS2, BOSS3, BOSS4, RAT, ROTATEGUN }; - int32_t i, SolidEnemies[] = { TANK, BOSS1, BOSS2, BOSS3, BOSS4, RECON, ROTATEGUN }; + int32_t SolidEnemies[] = { TANK, BOSS1, BOSS2, BOSS3, BOSS4, RECON, ROTATEGUN }; + int32_t NoWaterDipEnemies[] = { OCTABRAIN, COMMANDER, DRONE }; - for (i=GREENSLIME; i<=GREENSLIME+7; i++) + for (int i=GREENSLIME; i<=GREENSLIME+7; i++) SETFLAG(i, SFLAG_HARDCODED_BADGUY); - for (i=ARRAY_SIZE(DukeEnemies)-1; i>=0; i--) + for (int i=ARRAY_SIZE(DukeEnemies)-1; i>=0; i--) SETFLAG(DukeEnemies[i], SFLAG_HARDCODED_BADGUY); - for (i=ARRAY_SIZE(SolidEnemies)-1; i>=0; i--) + for (int i=ARRAY_SIZE(SolidEnemies)-1; i>=0; i--) SETFLAG(SolidEnemies[i], SFLAG_NODAMAGEPUSH); + + for (int i=ARRAY_SIZE(NoWaterDipEnemies)-1; i>=0; i--) + SETFLAG(NoWaterDipEnemies[i], SFLAG_NOWATERDIP); } #undef SETFLAG diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 0192c75cf..d4220654b 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -6010,6 +6010,7 @@ static void C_AddDefaultDefinitions(void) C_AddDefinition("SFLAG_SMOOTHMOVE", SFLAG_SMOOTHMOVE, LABEL_DEFINE); C_AddDefinition("SFLAG_NOTELEPORT", SFLAG_NOTELEPORT, LABEL_DEFINE); C_AddDefinition("SFLAG_NODAMAGEPUSH", SFLAG_NODAMAGEPUSH, LABEL_DEFINE); + C_AddDefinition("SFLAG_NOWATERDIP", SFLAG_NOWATERDIP, LABEL_DEFINE); C_AddDefinition("STR_MAPNAME",STR_MAPNAME,LABEL_DEFINE); C_AddDefinition("STR_MAPFILENAME",STR_MAPFILENAME,LABEL_DEFINE); diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index b0829c884..d54fef85b 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -944,13 +944,8 @@ static int32_t A_GetWaterZOffset(int spritenum) if (sector[sp->sectnum].lotag == ST_1_ABOVE_WATER) { - switch (DYNAMICTILEMAP(sp->picnum)) - { - case OCTABRAIN__STATIC: - case COMMANDER__STATIC: - case DRONE__STATIC: + if (A_CheckSpriteFlags(spritenum, SFLAG_NOWATERDIP)) return 0; - } // fix for flying/jumping monsters getting stuck in water if ((AC_MOVFLAGS(sp, ac) & jumptoplayer_only) || diff --git a/polymer/eduke32/source/lunatic/con_lang.lua b/polymer/eduke32/source/lunatic/con_lang.lua index fede58eae..c5995ea67 100644 --- a/polymer/eduke32/source/lunatic/con_lang.lua +++ b/polymer/eduke32/source/lunatic/con_lang.lua @@ -202,6 +202,7 @@ SFLAG = { SFLAG_HARDCODED_BADGUY = -0x00040000, SFLAG_DIDNOSE7WATER = -0x00080000, SFLAG_NODAMAGEPUSH = 0x00100000, + SFLAG_NOWATERDIP = 0x00200000, -- RESERVED for actor.FLAGS.chain_*/replace_*: -- 0x08000000, 0x10000000, 0x20000000, 0x40000000 }