diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 1e423415f..457746228 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -2734,10 +2734,7 @@ void DoPlayerMoveVehicle(PLAYERp pp) } psp->cstat = save_cstat; - //SetupDriveCrush(pp, x, y); - //DriveCrush(pp, x, y); - - if (u->ret) + if (u->coll.type != kHitNone) { int vel; diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 06d061fc1..fdc101338 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -1018,14 +1018,12 @@ int DoRipperMoveHang(DSWActor* actor) // if cannot move the sprite if (!move_actor(actor, nx, ny, 0L)) { - switch (TEST(u->ret, HIT_MASK)) - { - case HIT_WALL: + if (u->coll.type == kHitWall) { short hit_wall; short w, nw; - hit_wall = NORM_WALL(u->ret); + hit_wall = u->coll.index; NewStateGroup(actor, u->ActorActionSet->Special[1]); u->WaitTics = 2 + ((RANDOM_P2(4 << 8) >> 8) * 120); @@ -1037,7 +1035,6 @@ int DoRipperMoveHang(DSWActor* actor) return 0; } - } } return 0; diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index 3ea86ede0..9ce214af7 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -1019,18 +1019,16 @@ int DoRipper2MoveHang(DSWActor* actor) // if cannot move the sprite if (!move_actor(actor, nx, ny, 0L)) { - switch (TEST(u->ret, HIT_MASK)) - { - case HIT_WALL: + if (u->coll.type == kHitWall) { short hit_wall; short w, nw; // Don't keep clinging and going ever higher! if (abs(sp->z - u->targetActor->s().z) > (4000<<4)) - break; + return 0; - hit_wall = NORM_WALL(u->ret); + hit_wall = u->coll.index; NewStateGroup(actor, u->ActorActionSet->Special[1]); if (RANDOM_P2(1024<<8)>>8 > 500) @@ -1045,7 +1043,6 @@ int DoRipper2MoveHang(DSWActor* actor) return 0; } - } } return 0; diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index e23c719e6..297096162 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -3782,7 +3782,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) SetCollision(u, move_sprite(actor->GetSpriteIndex(), nx, ny, nz, u->ceiling_dist, u->floor_dist, 0, locktics)); - if (u->ret) + if (u->coll.type != kHitNone) { if (!TEST(u->Flags, SPR_JUMPING|SPR_FALLING)) ActorLeaveTrack(actor->GetSpriteIndex()); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 1a38077ad..d65572fc0 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -8018,7 +8018,7 @@ DoStar(DSWActor* actor) vel = ksqrt(SQ(u->xchange) + SQ(u->ychange)); if (vel < 500) - break; // will be killed below - u->ret != 0 + break; // will be killed below - hittype != 0 // 32000 to 96000 u->xchange = MulScale(u->xchange, 64000 + (RandomRange(64000) - 32000), 16); @@ -8860,9 +8860,6 @@ DoGrenade(DSWActor* actor) if (TEST(u->Flags, SPR_UNDERWATER) && (RANDOM_P2(1024 << 4) >> 4) < 256) SpawnBubble(actor); - ////DSPRINTF(ds, "dist %d, u->ret %d", FindDistance3D(u->xchange, u->ychange, u->zchange), u->ret); - //MONO_PRINT(ds); - if (u->ret) { switch (TEST(u->ret, HIT_MASK)) @@ -19252,7 +19249,8 @@ bool TestDontStick(DSWActor* actor, short hit_wall) { ASSERT(actor != nullptr); USERp u = actor->u(); - hit_wall = NORM_WALL(u->ret); + if (u->coll.type != kHitWall) return true; // ain't got a wall here. + hit_wall = u->coll.index; } wp = &wall[hit_wall];