diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 801ef3365..bc9f13a18 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -6947,10 +6947,9 @@ void ActorWarpType(DSWActor* sp, DSWActor* act_warp) // This moves a small projectile with FAFgetzrangepoint // -int -MissileWaterAdjust(short SpriteNum) +int MissileWaterAdjust(DSWActor* actor) { - USERp u = User[SpriteNum].Data(); + USERp u = actor->u(); if (u->lo_sectp) { @@ -7046,7 +7045,7 @@ move_missile(int spritenum, int xchange, int ychange, int zchange, int ceildist, // getzrangepoint moves water down // missiles don't need the water to be down - MissileWaterAdjust(spritenum); + MissileWaterAdjust(actor); clippos.z = sp->z + ((zchange * numtics) >> 3); @@ -7265,13 +7264,6 @@ move_ground_missile(short spritenum, int xchange, int ychange, int ceildist, int return retval; } - // getzrangepoint moves water down - // missiles don't need the water to be down - //MissileWaterAdjust(spritenum); - - //if (FAF_ConnectArea(sp->sectnum)) - // setspritez(spritenum, &sp->pos); - if (TEST(sector[sp->sectnum].extra, SECTFX_WARP_SECTOR)) { DSWActor* sp_warp; diff --git a/source/games/sw/src/sprite.h b/source/games/sw/src/sprite.h index 2cddd87b2..fcec7f0a4 100644 --- a/source/games/sw/src/sprite.h +++ b/source/games/sw/src/sprite.h @@ -56,7 +56,7 @@ int ActorCoughItem(DSWActor*); bool ActorSpawn(DSWActor*); int SpawnItemsMatch(short match); void PicAnimOff(short picnum); -int MissileWaterAdjust(short SpriteNum); +int MissileWaterAdjust(DSWActor*); bool SpriteOverlapZ(int16_t spritenum_a,int16_t spritenum_b,int z_overlap); enum diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 46f0212af..bf428e151 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -3897,7 +3897,7 @@ DoVomit(DSWActor* actor) { ChangeState(actor, s_VomitSplash); DoFindGroundPoint(actor); - MissileWaterAdjust(SpriteNum); + MissileWaterAdjust(actor); sp->z = u->loz; u->WaitTics = 60; u->sx = sp->xrepeat; @@ -7904,7 +7904,7 @@ DoStar(DSWActor* actor) sp->z += 128 * MISSILEMOVETICS; DoActorZrange(actor); - MissileWaterAdjust(Weapon); + MissileWaterAdjust(actor); if (sp->z > u->loz) { @@ -12057,7 +12057,7 @@ DoNapalm(DSWActor* actor) eu->Radius = 1500; DoFindGroundPoint(expActor); - MissileWaterAdjust(explosion); + MissileWaterAdjust(expActor); exp->z = eu->loz; exp->backupz(); @@ -19315,7 +19315,7 @@ bool SpriteWarpToSurface(DSWActor* actor) // set z range and wade depth so we know how high to set view DoActorZrange(actor); - MissileWaterAdjust(short(sp - sprite)); + MissileWaterAdjust(actor); sp->backuppos(); @@ -19344,7 +19344,7 @@ int SpawnSplash(DSWActor* actor) PlaySound(DIGI_SPLASH1, actor, v3df_none); DoActorZrange(actor); - MissileWaterAdjust(actor->GetSpriteIndex()); + MissileWaterAdjust(actor); auto actorNew = SpawnActor(STAT_MISSILE, SPLASH, s_Splash, sp->sectnum, sp->x, sp->y, u->loz, sp->ang, 0); wp = &actorNew->s(); diff --git a/source/games/sw/src/weapon.h b/source/games/sw/src/weapon.h index 8bc3a72c7..27293bdc7 100644 --- a/source/games/sw/src/weapon.h +++ b/source/games/sw/src/weapon.h @@ -79,7 +79,6 @@ void ScaleSpriteVector(DSWActor* actor, int scale); void QueueHole(short hit_sect, short hit_wall, int hit_x, int hit_y, int hit_z); DSWActor* QueueWallBlood(DSWActor* hit, short ang); bool SlopeBounce(DSWActor*, bool *hit_wall); -bool HitscanSpriteAdjust(short SpriteNum, short hit_wall); int SpawnSwordSparks(PLAYERp pp, short hit_sect, short hit_wall, int hit_x, int hit_y, int hit_z, short hit_ang); DSWActor* SpawnBubble(DSWActor*); int SpawnFireballExp(DSWActor*);