From 3781c43aecbf17c0aa0513da5e6ef175789ece57 Mon Sep 17 00:00:00 2001 From: Professor Hastig Date: Thu, 9 Nov 2023 07:24:37 +0100 Subject: [PATCH] allow defining zero gravity through MAPINFO --- src/g_level.cpp | 3 ++- src/gamedata/g_mapinfo.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 2fb9de298c9..b4b27c87328 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1830,7 +1830,8 @@ void FLevelLocals::Init() WallHorizLight = info->WallHorizLight*2; if (info->gravity != 0.f) { - gravity = info->gravity * 35/TICRATE; + if (info->gravity == DBL_MAX) gravity = 0; + else gravity = info->gravity * 35/TICRATE; } if (info->aircontrol != 0.f) { diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 1fec3346bc2..18fc4e1d30c 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1208,6 +1208,11 @@ DEFINE_MAP_OPTION(gravity, true) info->gravity = parse.sc.Float; } +DEFINE_MAP_OPTION(nogravity, true) +{ + info->gravity = DBL_MAX; +} + DEFINE_MAP_OPTION(aircontrol, true) { parse.ParseAssign();