From 6b780a822b95c26cb44fc5835325d909e7edad82 Mon Sep 17 00:00:00 2001 From: InspirationByte Date: Fri, 4 Feb 2022 21:15:00 +0300 Subject: [PATCH] - fix tyre track sides being swapped --- src_rebuild/Game/C/handling.c | 14 +++++++------- src_rebuild/Game/C/shadow.c | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src_rebuild/Game/C/handling.c b/src_rebuild/Game/C/handling.c index 35a8debf..77959c0d 100644 --- a/src_rebuild/Game/C/handling.c +++ b/src_rebuild/Game/C/handling.c @@ -1490,10 +1490,6 @@ void CheckCarEffects(CAR_DATA* cp, int player_id) char tracks_and_smoke; char channel, desired_skid, desired_wheel; - wheels_on_ground = 0; - lay_down_tracks = 0; - tracks_and_smoke = 0; - if (cp->controlType != CONTROL_TYPE_PLAYER && cp->controlType != CONTROL_TYPE_LEAD_AI && cp->controlType != CONTROL_TYPE_CUTSCENE) @@ -1508,6 +1504,10 @@ void CheckCarEffects(CAR_DATA* cp, int player_id) // [A] do hubcaps here HandlePlayerHubcaps(player_id); + wheels_on_ground = 0; + lay_down_tracks = 0; + tracks_and_smoke = 0; + for (cnt = 0; cnt < 4; cnt++) { if (cp->hd.wheel[cnt].susCompression != 0) @@ -1678,10 +1678,10 @@ void CheckCarEffects(CAR_DATA* cp, int player_id) { #if MAX_TYRE_TRACK_WHEELS == 4 ADD_WHEEL_TYRE_TRACK(0, 0) - ADD_WHEEL_TYRE_TRACK(2, 2) + ADD_WHEEL_TYRE_TRACK(2, 2) #else ADD_WHEEL_TYRE_TRACK(0, 0) - ADD_WHEEL_TYRE_TRACK(2, 1) + ADD_WHEEL_TYRE_TRACK(2, 1) #endif } else @@ -1699,7 +1699,7 @@ void CheckCarEffects(CAR_DATA* cp, int player_id) if (lay_down_tracks & 2) // front { ADD_WHEEL_TYRE_TRACK(1, 1) - ADD_WHEEL_TYRE_TRACK(3, 3) + ADD_WHEEL_TYRE_TRACK(3, 3) } else { diff --git a/src_rebuild/Game/C/shadow.c b/src_rebuild/Game/C/shadow.c index 044dd168..6d3aee03 100644 --- a/src_rebuild/Game/C/shadow.c +++ b/src_rebuild/Game/C/shadow.c @@ -76,19 +76,20 @@ void GetTyreTrackPositions(CAR_DATA *cp, int player_id) CarPos.vz = cp->hd.where.t[2]; car_cos = cp->ap.carCos; - SetRotMatrix(&cp->hd.drawCarMat); + SetRotMatrix(&cp->hd.where); steps = 4 / MAX_TYRE_TRACK_WHEELS; for (loop = 0; loop < 4; loop += steps) { + WheelPos.vx = car_cos->wheelDisp[loop].vx; if (loop & 2) - WheelPos.vx = car_cos->wheelDisp[loop].vx + 17; + WheelPos.vx += 17; else - WheelPos.vx = car_cos->wheelDisp[loop].vx - 17; + WheelPos.vx -= 17; WheelPos.vy = 0; - WheelPos.vz = -car_cos->wheelDisp[loop + 1 & 3].vz; + WheelPos.vz = car_cos->wheelDisp[loop + 1 & 3].vz; _MatrixRotate(&WheelPos);