From d71ad13fcf3a269e5b4fa6e88016b8932e656db6 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 19 Apr 2024 04:22:29 +0200 Subject: [PATCH] some smol fixes --- src/dehacked.c | 2 +- src/g_game.c | 7 +++++-- src/p_mobj.c | 2 +- src/p_polyobj.c | 6 +++--- src/v_video.c | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8c1ba8e4d..486584fa5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -334,7 +334,7 @@ static void readPlayer(MYFILE *f, INT32 num) // It works down here, though. { INT32 numline = 0; - for (i = 0; i < MAXLINELEN-1; i++) + for (i = 0; (size_t)i < sizeof(description[num].notes)-1; i++) { if (numline < 20 && description[num].notes[i] == '\n') numline++; diff --git a/src/g_game.c b/src/g_game.c index d7ac0e8ff..4161c6ca7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5897,7 +5897,7 @@ void G_GhostTicker(void) if (ziptic & EZT_THOKMASK) { // Let's only spawn ONE of these per frame, thanks. mobj_t *mobj; - INT32 type = -1; + UINT32 type = MT_NULL; if (g->mo->skin) { switch (ziptic & EZT_THOKMASK) @@ -6221,7 +6221,10 @@ void G_ReadMetalTic(mobj_t *metal) // Read changes from the tic if (ziptic & GZT_XYZ) { - P_MoveOrigin(metal, READFIXED(metal_p), READFIXED(metal_p), READFIXED(metal_p)); + oldmetal.x = READFIXED(metal_p); + oldmetal.y = READFIXED(metal_p); + oldmetal.z = READFIXED(metal_p); + P_MoveOrigin(metal, oldmetal.x, oldmetal.y, oldmetal.z); oldmetal.x = metal->x; oldmetal.y = metal->y; oldmetal.z = metal->z; diff --git a/src/p_mobj.c b/src/p_mobj.c index 7dba08f7a..dd139aeb5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1329,7 +1329,7 @@ void P_XYMovement(mobj_t *mo) fixed_t oldx, oldy; // reducing bobbing/momentum on ice when up against walls boolean moved; pslope_t *oldslope = NULL; - vector3_t slopemom; + vector3_t slopemom = {0,0,0}; fixed_t predictedz = 0; I_Assert(mo != NULL); diff --git a/src/p_polyobj.c b/src/p_polyobj.c index f614d6c1f..786a43c0f 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -1206,7 +1206,7 @@ static boolean Polyobj_moveXY(polyobj_t *po, fixed_t x, fixed_t y) // http://www.inversereality.org/tutorials/graphics%20programming/2dtransformations.html // It is, of course, just a vector-matrix multiplication. // -static inline void Polyobj_rotatePoint(vertex_t *v, const vertex_t *c, angle_t ang) +static inline void Polyobj_rotatePoint(vertex_t *v, const vector2_t *c, angle_t ang) { vertex_t tmp = *v; @@ -1267,7 +1267,7 @@ static void Polyobj_rotateLine(line_t *ld) // // Causes objects resting on top of the rotating polyobject to 'ride' with its movement. // -static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta, UINT8 turnthings) +static void Polyobj_rotateThings(polyobj_t *po, vector2_t origin, angle_t delta, UINT8 turnthings) { static INT32 pomovecount = 10000; INT32 x, y; @@ -1367,7 +1367,7 @@ static boolean Polyobj_rotate(polyobj_t *po, angle_t delta, UINT8 turnthings) { size_t i; angle_t angle; - vertex_t origin; + vector2_t origin; INT32 hitflags = 0; // don't move bad polyobjects diff --git a/src/v_video.c b/src/v_video.c index 7b9383f06..4ea028cc3 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -3370,7 +3370,7 @@ void V_Init(void) #ifdef DEBUG CONS_Debug(DBG_RENDER, "V_Init done:\n"); - for (i = 0; i < NUMSCREENS+1; i++) + for (i = 0; i < NUMSCREENS; i++) CONS_Debug(DBG_RENDER, " screens[%d] = %x\n", i, screens[i]); #endif }