From 5efa778509c60c2d62a04c6f02ea03d5a04917c3 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 13 Mar 2024 08:35:12 +0100 Subject: [PATCH] Revert "adjust the pointon funcs again" This reverts commit b5861b2beeb04b6de1fcbd2088069374658f31ee. --- src/d_netcmd.c | 14 ++++++++++++++ src/p_maputl.c | 15 ++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index d6115dc71..89c2dc85a 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -190,6 +190,7 @@ static void Command_Cheats_f(void); static void Command_ListSkins(void); static void Command_SkinSearch(void); + #ifdef _DEBUG static void Command_Togglemodified_f(void); static void Command_Archivetest_f(void); @@ -333,6 +334,19 @@ consvar_t cv_matchboxes = {"matchboxes", "Normal", CV_NETVAR|CV_CHEAT|CV_NOSHOWH consvar_t cv_specialrings = {"specialrings", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_powerstones = {"powerstones", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +/*consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_teleporters = {"tv_teleporter", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_superring = {"tv_superring", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_supersneakers = {"tv_supersneaker", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_invincibility = {"tv_invincibility", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_jumpshield = {"tv_jumpshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_watershield = {"tv_watershield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ringshield = {"tv_ringshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_forceshield = {"tv_forceshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_bombshield = {"tv_bombshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_1up = {"tv_1up", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/ + // SRB2kart consvar_t cv_sneaker = {"sneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_rocketsneaker = {"rocketsneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/p_maputl.c b/src/p_maputl.c index 71938aab6..a37433825 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -136,21 +136,22 @@ void P_ClosestPointOnLine3D(fixed_t x, fixed_t y, fixed_t z, line_t *line, verte // PUREFUNC INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line) { + const vertex_t *v1 = line->v1; fixed_t dx, dy, left, right; if (!line->dx) - return (x <= line->v1->x) ^ (line->dy <= 0); + return x <= v1->x ? line->dy > 0 : line->dy < 0; if (!line->dy) - return (y <= line->v1->y) ^ (line->dx >= 0); + return y <= v1->y ? line->dx < 0 : line->dx > 0; - dx = (x - line->v1->x); - dy = (y - line->v1->y); + dx = (x - v1->x); + dy = (y - v1->y); left = FixedMul(line->dy>>FRACBITS, dx); right = FixedMul(dy, line->dx>>FRACBITS); - return right >= left; + return (right < left) ? 0 : 1; } // @@ -210,10 +211,10 @@ PUREFUNC FUNCINLINE static ATTRINLINE INT32 P_PointOnDivlineSide(fixed_t x, fixe fixed_t dx, dy; if (!line->dx) - return (x <= line->x) ^ (line->dy <= 0); + return x <= line->x ? line->dy > 0 : line->dy < 0; if (!line->dy) - return (y <= line->y) ^ (line->dx >= 0); + return y <= line->y ? line->dx < 0 : line->dx > 0; dx = (x - line->x); dy = (y - line->y);