Skip to content

Commit da96c07

Browse files
author
Niko
committed
IF guard for unused spring weapon
1 parent a789d7a commit da96c07

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

decompile/General/Vehicle/TEST_VehPhysGeneral_JumpAndFriction.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,13 @@ void FUN_80060630(struct Thread* t, struct Driver* d)
7878
uVar14 = 0;
7979
*(unsigned int *)(puVar15 + 0x20) = *(unsigned int *)(uVar12 + 0x90);
8080
iVar9 = 0;
81+
8182
if ((*(unsigned int *)(uVar12 + 0x2c8) & 1) == 0) {
83+
8284
LAB_80060ab0:
85+
86+
// UNUSED Spring Weapon
87+
#if 0
8388
if (((*(unsigned int *)(uVar12 + 0x2c8) & 0x8000) != 0) && (*(char *)(uVar12 + 0x36) == '\x05')) {
8489
*(unsigned int *)(uVar12 + 0x2c8) = *(unsigned int *)(uVar12 + 0x2c8) & 0xffff7fff;
8590
if ((*(short *)(uVar12 + 0x3f4) != 0) && (*(short *)(uVar12 + 0x3f2) == 0)) {
@@ -95,7 +100,9 @@ void FUN_80060630(struct Thread* t, struct Driver* d)
95100
}
96101
*(unsigned short *)(uVar12 + 0x3c) = 0;
97102
}
98-
if (*(char *)(uVar12 + 0x366) == '\0') {
103+
#endif
104+
105+
if (*(char *)(uVar12 + 0x366) == '\0') {
99106
if (((*(short *)(uVar12 + 0x3f4) == 0) || (*(short *)(uVar12 + 0x3f0) == 0)) ||
100107
(*(short *)(uVar12 + 0x3f2) != 0)) {
101108
if ((*(unsigned int *)(uVar12 + 0x2c8) & 1) != 0) {

decompile/General/Vehicle/VehPhysGeneral_4_JumpAndFriction.c

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ void DECOMP_VehPhysGeneral_JumpAndFriction(struct Thread *t, struct Driver *d)
9191

9292
CHECK_FOR_ANY_JUMP:
9393

94-
94+
// UNUSED Spring Weapon
95+
#if 0
9596
// If you want to fire a weapon
9697
if (((d->actionsFlagSet & 0x8000) != 0) &&
9798

@@ -119,6 +120,7 @@ void DECOMP_VehPhysGeneral_JumpAndFriction(struct Thread *t, struct Driver *d)
119120
}
120121
d->noItemTimer = 0;
121122
}
123+
#endif
122124

123125
// if not being forced to jump (turtles), this should cause the tiny jumps on top of walls.
124126
if (d->forcedJump_trampoline == 0)
@@ -232,7 +234,7 @@ void DECOMP_VehPhysGeneral_JumpAndFriction(struct Thread *t, struct Driver *d)
232234
((-1 < d->baseSpeed || (-1 < iVar8)))) goto PROCESS_ACCEL;
233235
}
234236

235-
iVar9 = d->const_Accel_ClassStat + (d->accelConst << 5) / 5;
237+
iVar9 = d->const_Accel_ClassStat + ((int)d->accelConst << 5) / 5;
236238

237239
if ((d->stepFlagSet & 3) == 0)
238240
{
@@ -263,21 +265,33 @@ void DECOMP_VehPhysGeneral_JumpAndFriction(struct Thread *t, struct Driver *d)
263265

264266
if (d->baseSpeed < 0) {
265267
d->unk_offset3B2 = -(short)uVar10;
268+
269+
movement.vx -= param_1;
270+
movement.vy -= param_2;
271+
movement.vz -= param_3;
272+
273+
// unused?
274+
#if 0
266275
d->unkVectorX = -(short)param_1;
267276
d->unkVectorY = -(short)param_2;
268277
d->unkVectorZ = -(short)param_3;
278+
#endif
269279
}
270280
else {
271281
d->unk_offset3B2 = (short)uVar10;
282+
283+
movement.vx += param_1;
284+
movement.vy += param_2;
285+
movement.vz += param_3;
286+
287+
// unused?
288+
#if 0
272289
d->unkVectorX = (short)param_1;
273290
d->unkVectorY = (short)param_2;
274291
d->unkVectorZ = (short)param_3;
275-
}
276-
277-
movement.vx += d->unkVectorX;
278-
movement.vy += d->unkVectorY;
279-
movement.vz += d->unkVectorZ;
280-
292+
#endif
293+
}
294+
281295
uVar14 = VehCalc_FastSqrt(
282296
movement.vx * movement.vx +
283297
movement.vy * movement.vy +

0 commit comments

Comments
 (0)