From c651045ed330302d0adbd51e285aec385ad02ee9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Jan 2019 15:37:14 +0100 Subject: [PATCH] - let RunHealth clamping respect the newly added global properties. --- src/gi.cpp | 2 ++ wadsrc/static/zscript/base.txt | 2 ++ wadsrc/static/zscript/shared/player.txt | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gi.cpp b/src/gi.cpp index cce28d49ad..efcfe74dae 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -71,6 +71,8 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, defKickback) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, healthpic) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, berserkpic) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, defaultdropstyle) +DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, normforwardmove) +DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, normsidemove) const char *GameNames[17] = { diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index e7d0436f7d..704e736d29 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -374,6 +374,8 @@ struct GameInfoStruct native native int defaultdropstyle; native TextureID healthpic; native TextureID berserkpic; + native double normforwardmove[2]; + native double normsidemove[2]; } class Object native diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index 04d3ec715a..2248ddc42f 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -1183,8 +1183,8 @@ class PlayerPawn : Actor // Strife's player can't run when its health is below 10 if (health <= RunHealth) { - forward = clamp(forward, -0x1900, 0x1900); - side = clamp(side, -0x1800, 0x1800); + forward = clamp(forward, -gameinfo.normforwardmove[0], gameinfo.normforwardmove[0]); + side = clamp(side, -gameinfo.normsidemove[0], gameinfo.normsidemove[0]); } // [GRB]