Skip to content

Commit

Permalink
- fix tyre track sides being swapped
Browse files Browse the repository at this point in the history
  • Loading branch information
SoapyMan committed Feb 4, 2022
1 parent 4086bba commit 6b780a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src_rebuild/Game/C/handling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
{
Expand Down
9 changes: 5 additions & 4 deletions src_rebuild/Game/C/shadow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 6b780a8

Please sign in to comment.