From 3170591e32402a595332b73d2a3fdfa360c57a33 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Feb 2017 21:08:48 +0100 Subject: [PATCH] - restated some weird number manipulation in SBARINFO for powerup time. This appears to be needed to distinguish between non-expiring items and non-present items. --- src/g_statusbar/sbarinfo_commands.cpp | 2 +- wadsrc/static/zscript/shared/player.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_statusbar/sbarinfo_commands.cpp b/src/g_statusbar/sbarinfo_commands.cpp index 6e6b55bec6..ae6ba5b000 100644 --- a/src/g_statusbar/sbarinfo_commands.cpp +++ b/src/g_statusbar/sbarinfo_commands.cpp @@ -1442,7 +1442,7 @@ class CommandDrawNumber : public CommandDrawString int retv; VMReturn ret(&retv); GlobalVMStack.Call(func, params, 2, &ret, 1); - num = retv / TICRATE + 1; + num = retv < 0? 0 : retv / TICRATE + 1; break; } case INVENTORY: diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index 7b8ba8f307..9039b37b6b 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -130,7 +130,7 @@ class PlayerPawn : Actor native return powerup.EffectTics, maxtics; } } - return 0, 0; + return -1, -1; } native int GetMaxHealth();