From 05a5a4be51dccf4d11489bf43cdb46ed8cd33c66 Mon Sep 17 00:00:00 2001 From: inkoalawetrust <56005600+inkoalawetrust@users.noreply.github.com> Date: Sun, 25 Sep 2022 06:41:23 +0300 Subject: [PATCH] Added the QF_GROUNDONLY flag. The QF_GROUNDONLY flag makes earthquakes only shake the player while they are standing on the ground. --- src/playsim/a_sharedglobal.h | 1 + src/playsim/mapthinkers/a_quake.cpp | 2 +- wadsrc/static/zscript/constants.zs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/playsim/a_sharedglobal.h b/src/playsim/a_sharedglobal.h index d9497bc73..3a9a02272 100644 --- a/src/playsim/a_sharedglobal.h +++ b/src/playsim/a_sharedglobal.h @@ -113,6 +113,7 @@ enum QF_FULLINTENSITY = 1 << 4, QF_WAVE = 1 << 5, QF_3D = 1 << 6, + QF_GROUNDONLY = 1 << 7, }; struct FQuakeJiggers diff --git a/src/playsim/mapthinkers/a_quake.cpp b/src/playsim/mapthinkers/a_quake.cpp index f207a523d..ca69d305e 100644 --- a/src/playsim/mapthinkers/a_quake.cpp +++ b/src/playsim/mapthinkers/a_quake.cpp @@ -295,7 +295,7 @@ int DEarthquake::StaticGetQuakeIntensities(double ticFrac, AActor *victim, FQuak while ( (quake = iterator.Next()) != nullptr) { - if (quake->m_Spot != nullptr) + if (quake->m_Spot != nullptr && !(quake->m_Flags & QF_GROUNDONLY && victim->Z() > victim->floorz)) { double dist; diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index f5fcfc33b..1887ddce1 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -643,6 +643,7 @@ enum EQuakeFlags QF_FULLINTENSITY = 1 << 4, QF_WAVE = 1 << 5, QF_3D = 1 << 6, + QF_GROUNDONLY = 1 << 7, }; // A_CheckProximity flags