From 9797ae31a669d635223a7f80871b3f3be997497d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 2 Jul 2017 16:48:58 +0100 Subject: [PATCH 1/8] Fix the springs jumping! The issue was that because both them and the player had MF_SOLID, the tmfloorz of the spring was getting set to above the player (or vicea versa with tmceilingz), forcing it upwards with them under certain circumstances. Now, springs only acknowledge the solidity (for purpose of tmfloorz/tmceilingz) of objects they CAN'T launch. --- src/p_map.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 86776f8d..81bf9ebe 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -956,6 +956,8 @@ static boolean PIT_CheckThing(mobj_t *thing) if (iwassprung) // this spring caused you to gain MFE_SPRUNG just now... return false; // "cancel" P_TryMove via blocking so you keep your current position } + else if (tmthing->flags & MF_SPRING && (thing->player || thing->flags & MF_PUSHABLE)) + ; // Fix a few nasty spring-jumping bugs that happen sometimes. // Monitors are not treated as solid to players who are jumping, spinning or gliding, // unless it's a CTF team monitor and you're on the wrong team else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) @@ -987,11 +989,13 @@ static boolean PIT_CheckThing(mobj_t *thing) topz = thing->z - thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways + if (thing->flags & MF_SPRING) + ; // block only when jumping not high enough, // (dont climb max. 24units while already in air) // since return false doesn't handle momentum properly, // we lie to P_TryMove() so it's always too high - if (tmthing->player && tmthing->z + tmthing->height > topz + else if (tmthing->player && tmthing->z + tmthing->height > topz && tmthing->z + tmthing->height < tmthing->ceilingz) { tmfloorz = tmceilingz = topz; // block while in air @@ -1000,8 +1004,6 @@ static boolean PIT_CheckThing(mobj_t *thing) #endif tmfloorthing = thing; // needed for side collision } - else if (thing->flags & MF_SPRING) - ; else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height) { tmceilingz = topz; @@ -1030,11 +1032,13 @@ static boolean PIT_CheckThing(mobj_t *thing) topz = thing->z + thing->height + thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways + if (thing->flags & MF_SPRING) + ; // block only when jumping not high enough, // (dont climb max. 24units while already in air) // since return false doesn't handle momentum properly, // we lie to P_TryMove() so it's always too high - if (tmthing->player && tmthing->z < topz + else if (tmthing->player && tmthing->z < topz && tmthing->z > tmthing->floorz) { tmfloorz = tmceilingz = topz; // block while in air @@ -1043,8 +1047,6 @@ static boolean PIT_CheckThing(mobj_t *thing) #endif tmfloorthing = thing; // needed for side collision } - else if (thing->flags & MF_SPRING) - ; else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z) { tmfloorz = topz; From c751971d57a347e11b008af2e26e1cafbab653a5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 2 Jul 2017 16:50:11 +0100 Subject: [PATCH 2/8] Fix integer type slipup in ArchiveValue for saving mobjinfo/state #s that LJSonic spotted Apart from the fact that UnArchiveValue reads UINT16 for both anyway (which alone causes problems), but UINT8 isn't even enough to store the higher end of the object types list and definitely most of the states welp --- src/lua_script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index acb30682..991b8fcf 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -566,14 +566,14 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) { mobjinfo_t *info = *((mobjinfo_t **)lua_touserdata(gL, myindex)); WRITEUINT8(save_p, ARCH_MOBJINFO); - WRITEUINT8(save_p, info - mobjinfo); + WRITEUINT16(save_p, info - mobjinfo); break; } case ARCH_STATE: { state_t *state = *((state_t **)lua_touserdata(gL, myindex)); WRITEUINT8(save_p, ARCH_STATE); - WRITEUINT8(save_p, state - states); + WRITEUINT16(save_p, state - states); break; } case ARCH_MOBJ: From 60e21381abfe2652fd417aeed8760acffc62e138 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 5 Jul 2017 16:20:23 +0100 Subject: [PATCH 3/8] Don't kick Tails! Also, a movement for the WRITESINT8 to prevent modification to buf if the function bails early. --- src/d_clisrv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 312a308a..5021f9a7 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2587,6 +2587,9 @@ static void Command_Kick(void) XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; UINT8 *p = buf; + if (!netgame) // Don't kick Tails in splitscreen! + return; + if (COM_Argc() == 1) { CONS_Printf(M_GetText("kick : kick a player\n")); @@ -2596,9 +2599,10 @@ static void Command_Kick(void) if (server || adminplayer == consoleplayer) { const SINT8 pn = nametonum(COM_Argv(1)); - WRITESINT8(p, pn); + if (pn == -1 || pn == 0) return; + // Special case if we are trying to kick a player who is downloading the game state: // trigger a timeout instead of kicking them, because a kick would only // take effect after they have finished downloading @@ -2607,6 +2611,9 @@ static void Command_Kick(void) Net_ConnectionTimeout(playernode[pn]); return; } + + WRITESINT8(p, pn); + if (COM_Argc() == 2) { WRITEUINT8(p, KICK_MSG_GO_AWAY); From 9a1e1180ff8479b59dff12cc77159b92d52d0bf1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 5 Jul 2017 16:29:21 +0100 Subject: [PATCH 4/8] Also account for bans, pff. --- src/d_clisrv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 5021f9a7..3fdd9652 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2525,6 +2525,9 @@ static void Command_Nodes(void) static void Command_Ban(void) { + if (!netgame) // Don't kick Tails in splitscreen! + return; + if (COM_Argc() == 1) { CONS_Printf(M_GetText("Ban : ban and kick a player\n")); @@ -2540,8 +2543,9 @@ static void Command_Ban(void) if (pn == -1 || pn == 0) return; - else - WRITEUINT8(p, pn); + + WRITEUINT8(p, pn); + if (server && I_Ban && !I_Ban(node)) // only the server is allowed to do this right now { CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n")); From aca7a574f82ceacb8a3be63b2267867a8e15c324 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 5 Jul 2017 17:05:39 +0100 Subject: [PATCH 5/8] Copy+paste st_stuff.c functions and macros to accurately draw SCORE/TIME on the tally screen like they are when actually playing the level --- src/y_inter.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 2fd37ff3..ff4b798f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -159,6 +159,20 @@ static void Y_CalculateMatchWinners(void); static void Y_FollowIntermission(void); static void Y_UnloadData(void); +// Stuff copy+pasted from st_stuff.c +static INT32 SCX(INT32 x) +{ + return FixedInt(FixedMul(x< Date: Wed, 5 Jul 2017 19:25:11 +0100 Subject: [PATCH 6/8] Display minutes in full, so 60:00 for instance displays as 60:00 and not 0:00 The normal HUD display while playing a level doesn't do this, only the tally screen does it for some reason --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index ff4b798f..bfcb0f5b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -230,7 +230,7 @@ void Y_IntermissionDrawer(void) INT32 seconds, minutes, tictrn; seconds = G_TicsToSeconds(data.coop.tics); - minutes = G_TicsToMinutes(data.coop.tics, false); + minutes = G_TicsToMinutes(data.coop.tics, true); tictrn = G_TicsToCentiseconds(data.coop.tics); ST_DrawNumFromHud(HUD_MINUTES, minutes); // Minutes From e8df99c632ecdb91489b601d09e486870b38750f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 5 Jul 2017 22:30:18 +0100 Subject: [PATCH 7/8] They didn't use V_HUDTRANS before and they probably shouldn't, my fault here --- src/y_inter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index bfcb0f5b..acf1c6f2 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -169,9 +169,9 @@ static INT32 SCY(INT32 z) return FixedInt(FixedMul(z< Date: Fri, 7 Jul 2017 22:40:00 +0100 Subject: [PATCH 8/8] Some more tweaks of my own: *Add CONS_Printf messages for !netgame checks *Arg count is checked first regardless of netgame status for both kick and ban, < 2 is checked instead of == 1 just in case these weren't called from console for some stupid reason? *Moved Command_Kick's buffer vars to within the code that actually does kicking stuff --- src/d_clisrv.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 3fdd9652..7c21d79f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2525,15 +2525,18 @@ static void Command_Nodes(void) static void Command_Ban(void) { - if (!netgame) // Don't kick Tails in splitscreen! - return; - - if (COM_Argc() == 1) + if (COM_Argc() < 2) { CONS_Printf(M_GetText("Ban : ban and kick a player\n")); return; } + if (!netgame) // Don't kick Tails in splitscreen! + { + CONS_Printf(M_GetText("This only works in a netgame.\n")); + return; + } + if (server || adminplayer == consoleplayer) { XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; @@ -2588,20 +2591,22 @@ static void Command_Ban(void) static void Command_Kick(void) { - XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; - UINT8 *p = buf; - - if (!netgame) // Don't kick Tails in splitscreen! - return; - - if (COM_Argc() == 1) + if (COM_Argc() < 2) { CONS_Printf(M_GetText("kick : kick a player\n")); return; } + if (!netgame) // Don't kick Tails in splitscreen! + { + CONS_Printf(M_GetText("This only works in a netgame.\n")); + return; + } + if (server || adminplayer == consoleplayer) { + XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; + UINT8 *p = buf; const SINT8 pn = nametonum(COM_Argv(1)); if (pn == -1 || pn == 0)