From f67d3270d8284de56270e78afc9737164d094d02 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Jul 2020 17:04:02 +0200 Subject: [PATCH] - fixed a few cheat issues. Fixes #29. --- source/games/duke/src/cheats.cpp | 10 +++++----- source/glbackend/glbackend.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/games/duke/src/cheats.cpp b/source/games/duke/src/cheats.cpp index 850968a0f..194c2efec 100644 --- a/source/games/duke/src/cheats.cpp +++ b/source/games/duke/src/cheats.cpp @@ -82,7 +82,7 @@ bool cheatInventory(cheatseq_t *s) } }; - invGet(400, EVENT_CHEATGETSTEROIDS, ps[myconnectindex].steroids_amount); + invGet(400, EVENT_CHEATGETSTEROIDS, ps[myconnectindex].steroids_amount); if (!isRR()) invGet(1200, EVENT_CHEATGETHEAT, ps[myconnectindex].heat_amount); invGet(isRR() ? 2000 : 200, EVENT_CHEATGETBOOT, ps[myconnectindex].boot_amount); invGet(100, EVENT_CHEATGETSHIELD, ps[myconnectindex].shield_amount); @@ -90,6 +90,7 @@ bool cheatInventory(cheatseq_t *s) invGet(2400, EVENT_CHEATGETHOLODUKE, ps[myconnectindex].holoduke_amount); invGet(isRR() ? 600 : 1600, EVENT_CHEATGETJETPACK, ps[myconnectindex].jetpack_amount); invGet(max_player_health, EVENT_CHEATGETFIRSTAID, ps[myconnectindex].firstaid_amount); + if (ps[myconnectindex].inven_icon == ICON_NONE) C_DoCommand("invnext"); if (s) FTA(120,&ps[myconnectindex]); return true; } @@ -291,10 +292,9 @@ static bool cheatHyper(cheatseq_t *) static bool cheatMonsters(cheatseq_t *) { - if(actor_tog == 3) actor_tog = 0; - actor_tog++; - static const char *s [] = { "OPTVAL_ON", "OPTVAL_OFF", "$TXT_ON2" }; - Printf(PRINT_NOTIFY, "%s: %s", GStrings("NETMNU_MONSTERS"), s[actor_tog]); + if(++actor_tog == 3) actor_tog = 0; + static const char *s [] = { "OPTVAL_ON", "OPTVAL_OFF", "TXT_ON2" }; + Printf(PRINT_NOTIFY, "%s: %s", GStrings("NETMNU_MONSTERS"), GStrings(s[actor_tog])); return true; } diff --git a/source/glbackend/glbackend.cpp b/source/glbackend/glbackend.cpp index 8e79f074e..fbdb22b88 100644 --- a/source/glbackend/glbackend.cpp +++ b/source/glbackend/glbackend.cpp @@ -431,13 +431,14 @@ static FString statFPS() double frameDelay = frameTime - lastFrameTime; cumulativeFrameDelay += frameDelay; + frameCount++; if (frameDelay >= 0) { output.AppendFormat("%5.1f fps (%.1f ms)\n", lastFPS, frameDelay); if (cumulativeFrameDelay >= 1000.0) { - lastFPS = 1000.f * frameCount / cumulativeFrameDelay; + lastFPS = 1000. * frameCount / cumulativeFrameDelay; frameCount = 0; cumulativeFrameDelay = 0.0; }