From e63871d6f5625181c265c770f9dd2205ea05d6d1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:40:21 +0200 Subject: [PATCH] - made 3D floor damage transfers optional by adding a new flag bit (2048) and made that mode automatic for the old ZDoom-based light only transfer special. --- src/maploader/specials.cpp | 5 +++-- src/playsim/p_3dfloors.cpp | 5 +++-- src/playsim/p_3dfloors.h | 2 +- wadsrc/static/zscript/mapdata.zs | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/maploader/specials.cpp b/src/maploader/specials.cpp index 64f3ea7b8..240b0818b 100644 --- a/src/maploader/specials.cpp +++ b/src/maploader/specials.cpp @@ -943,7 +943,8 @@ int MapLoader::Set3DFloor(line_t * line, int param, int param2, int alpha) // if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough if ((param2 & 128) && !(flags & FF_SOLID)) flags |= FF_FLOOD | FF_SEETHROUGH | FF_SHOOTTHROUGH; if (param2 & 512) flags |= FF_FADEWALLS; - if (param2&1024) flags |= FF_RESET; + if (param2 & 1024) flags |= FF_RESET; + if (param2 & 2048) flags |= FF_NODAMAGE; FTextureID tex = line->sidedef[0]->GetTexture(side_t::top); if (!tex.Exists() && alpha < 255) { @@ -970,7 +971,7 @@ int MapLoader::Set3DFloor(line_t * line, int param, int param2, int alpha) void MapLoader::Spawn3DFloors () { - static int flagvals[] = {512, 2+512, 512+1024}; + static int flagvals[] = {512+2048, 2+512+2048, 512+1024+2048}; for (auto &line : Level->lines) { diff --git a/src/playsim/p_3dfloors.cpp b/src/playsim/p_3dfloors.cpp index 7d7c60889..ece17634b 100644 --- a/src/playsim/p_3dfloors.cpp +++ b/src/playsim/p_3dfloors.cpp @@ -217,10 +217,11 @@ void P_PlayerOnSpecial3DFloor(player_t* player) // Player must be on top of the floor to be affected... if(player->mo->Z() != rover->top.plane->ZatPoint(player->mo)) continue; } - else + else { //Water and DEATH FOG!!! heh - if (player->mo->Z() > rover->top.plane->ZatPoint(player->mo) || + if ((rover->flags & FF_NODAMAGE) || + player->mo->Z() > rover->top.plane->ZatPoint(player->mo) || player->mo->Top() < rover->bottom.plane->ZatPoint(player->mo)) continue; } diff --git a/src/playsim/p_3dfloors.h b/src/playsim/p_3dfloors.h index f0b1e87fd..05d222137 100644 --- a/src/playsim/p_3dfloors.h +++ b/src/playsim/p_3dfloors.h @@ -23,7 +23,7 @@ typedef enum FF_UPPERTEXTURE = 0x20000, FF_LOWERTEXTURE = 0x40000, FF_THINFLOOR = 0x80000, // EDGE - FF_SCROLLY = 0x100000, // EDGE - not yet implemented!!! + FF_NODAMAGE = 0x100000, // no damage transfers FF_FIX = 0x200000, // use floor of model sector as floor and floor of real sector as ceiling FF_INVERTSECTOR = 0x400000, // swap meaning of sector planes FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap diff --git a/wadsrc/static/zscript/mapdata.zs b/wadsrc/static/zscript/mapdata.zs index 1ac5f12de..b681711d4 100644 --- a/wadsrc/static/zscript/mapdata.zs +++ b/wadsrc/static/zscript/mapdata.zs @@ -234,7 +234,8 @@ struct F3DFloor native play FF_UPPERTEXTURE = 0x20000, FF_LOWERTEXTURE = 0x40000, FF_THINFLOOR = 0x80000, // EDGE - FF_SCROLLY = 0x100000, // EDGE - not yet implemented!!! + FF_SCROLLY = 0x100000, // old leftover definition + FF_NODAMAGE = 0x100000, // no damage transfers FF_FIX = 0x200000, // use floor of model sector as floor and floor of real sector as ceiling FF_INVERTSECTOR = 0x400000, // swap meaning of sector planes FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap