Skip to content

Commit

Permalink
allow defining zero gravity through MAPINFO
Browse files Browse the repository at this point in the history
  • Loading branch information
prof-hastig authored and madame-rachelle committed Nov 9, 2023
1 parent d5e9783 commit 3781c43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/g_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions src/gamedata/g_mapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3781c43

Please sign in to comment.