From 90b0b7f498372bf05342168eec166e0cc12c6ecc Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 19 Oct 2019 14:11:24 -0700 Subject: [PATCH 1/5] Don't hide HUD with hu_showscores in single player/Record Attack This also makes Lua game HUD consistent with the Kart HUD. --- src/st_stuff.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 50bac3eef..77308b338 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1799,10 +1799,12 @@ static void ST_doItemFinderIconsAndSound(void) // SRB2kart - unused. // static void ST_overlayDrawer(void) { - /* SRB2kart doesn't need this stuff //hu_showscores = auto hide score/time/rings when tab rankings are shown if (!(hu_showscores && (netgame || multiplayer))) { + K_drawKartHUD(); + + /* SRB2kart doesn't need this stuff if (maptol & TOL_NIGHTS) ST_drawNiGHTSHUD(); else @@ -1826,8 +1828,8 @@ static void ST_overlayDrawer(void) ) ST_drawLives(); } - } */ + } // GAME OVER pic /*if (G_GametypeUsesLives() && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer))) @@ -1847,8 +1849,6 @@ static void ST_overlayDrawer(void) // Countdown timer for Race Mode // ...moved to k_kart.c so we can take advantage of the LAPS_Y value - K_drawKartHUD(); - /* SRB2kart doesn't need this stuff, I think // If you are in overtime, put a big honkin' flashin' message on the screen. if (G_BattleGametype() && cv_overtime.value From 6e3a92ed52512622c177e4dc4a4205dbe311fbda Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 13 May 2020 16:17:40 -0700 Subject: [PATCH 2/5] player.ping for the ping in milliseconds of the player --- src/lua_playerlib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index d9766513b..356cdd329 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -17,6 +17,7 @@ #include "d_player.h" #include "g_game.h" #include "p_local.h" +#include "d_clisrv.h" #include "lua_script.h" #include "lua_libs.h" @@ -385,6 +386,8 @@ static int player_get(lua_State *L) else if (fastcmp(field,"fovadd")) lua_pushfixed(L, plr->fovadd); #endif + else if (fastcmp(field,"ping")) + lua_pushinteger(L, playerpingtable[( plr - players )]); else { lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1)); From e502397a98077ca975cc10693efe5c30563ad34b Mon Sep 17 00:00:00 2001 From: Snu Date: Thu, 14 May 2020 03:13:00 +0100 Subject: [PATCH 3/5] add targets to MT_FASTLINEs spawned to tell what they're spawned from --- src/k_kart.c | 1 + src/p_enemy.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index cc5504bb4..02f34ce4e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4486,6 +4486,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->y + (P_RandomRange(-36,36) * player->mo->scale), player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale), MT_FASTLINE); + fast->target = player.mo; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; diff --git a/src/p_enemy.c b/src/p_enemy.c index a3bf5491b..e34686be3 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8511,6 +8511,7 @@ void A_SPBChase(mobj_t *actor) actor->y + (P_RandomRange(-24,24) * actor->scale), actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale), MT_FASTLINE); + fast->target = actor; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy); //fast->momx = (3*actor->momx)/4; //fast->momy = (3*actor->momy)/4; From d40b5dd73ee517ffe9a6c2fef437b061e2c3afa5 Mon Sep 17 00:00:00 2001 From: Snu Date: Thu, 14 May 2020 03:23:28 +0100 Subject: [PATCH 4/5] god damnit --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 02f34ce4e..e90092a9c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4486,7 +4486,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->y + (P_RandomRange(-36,36) * player->mo->scale), player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale), MT_FASTLINE); - fast->target = player.mo; // makes it easier to link it back to afterwards + fast->target = player->mo; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; From 9dda3a2edf4e849dfb8f67cc56212be88e1eb6b4 Mon Sep 17 00:00:00 2001 From: Snu Date: Thu, 14 May 2020 04:17:24 +0100 Subject: [PATCH 5/5] Use P_SetTarget instead of fast->target --- src/k_kart.c | 2 +- src/p_enemy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index e90092a9c..7ac35cd31 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4486,11 +4486,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->y + (P_RandomRange(-36,36) * player->mo->scale), player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale), MT_FASTLINE); - fast->target = player->mo; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; fast->momz = 3*player->mo->momz/4; + P_SetTarget(&fast->target, player->mo); // easier lua access K_MatchGenericExtraFlags(fast, player->mo); } diff --git a/src/p_enemy.c b/src/p_enemy.c index e34686be3..2693c8ccb 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8511,13 +8511,13 @@ void A_SPBChase(mobj_t *actor) actor->y + (P_RandomRange(-24,24) * actor->scale), actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale), MT_FASTLINE); - fast->target = actor; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy); //fast->momx = (3*actor->momx)/4; //fast->momy = (3*actor->momy)/4; //fast->momz = (3*actor->momz)/4; fast->color = SKINCOLOR_RED; fast->colorized = true; + P_SetTarget(&fast->target, actor); // easier lua access K_MatchGenericExtraFlags(fast, actor); }