diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 2be9d7bde..f3ee8979a 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1523,7 +1523,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) } else if (j == kHitSprite) { - fi.checkhitsprite(actor->GetIndex(), coll.actor->GetIndex()); + fi.checkhitsprite(actor, coll.actor); } s->xvel--; diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 2aba4bd3a..878b18aed 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -424,7 +424,7 @@ SKIPWALLCHECK: { if (badguy(act2) && !cansee(spri2->x, spri2->y, spri2->z + q, spri2->sectnum, spri->x, spri->y, spri->z + q, spri->sectnum)) continue; - fi.checkhitsprite(act2->GetIndex(), actor->GetIndex()); + fi.checkhitsprite(act2, actor); } } else if (spri2->extra >= 0 && act2 != actor && (spri2->picnum == TRIPBOMB || badguy(act2) || spri2->picnum == QUEBALL || spri2->picnum == STRIPEBALL || (spri2->cstat & 257) || spri2->picnum == DUKELYINGDEAD)) @@ -500,7 +500,7 @@ SKIPWALLCHECK: spri2->picnum == FEM8 || spri2->picnum == FEM9 || spri2->picnum == FEM10 || spri2->picnum == STATUE || spri2->picnum == STATUEFLASH || spri2->picnum == SPACEMARINE || spri2->picnum == QUEBALL || spri2->picnum == STRIPEBALL) - fi.checkhitsprite(act2->GetIndex(), actor->GetIndex()); + fi.checkhitsprite(act2, actor); } else if (spri->extra == 0) act2->extra = 0; @@ -1629,7 +1629,7 @@ static bool weaponhitsprite(DDukeActor* proj, DDukeActor *targ, bool fireball) } if (!isWorldTour() || s->picnum != FIREBALL || fireball) - fi.checkhitsprite(targ->GetIndex(), proj->GetIndex()); + fi.checkhitsprite(targ, proj); if (targ->s.picnum == APLAYER) { @@ -2802,7 +2802,7 @@ static void flamethrowerflame(DDukeActor *actor) s->xvel = s->yvel = s->zvel = 0; if (coll.type == kHitSprite) { - fi.checkhitsprite(coll.actor->GetIndex(), actor->GetIndex()); + fi.checkhitsprite(coll.actor, actor); if (coll.actor->s.picnum == APLAYER) S_PlayActorSound(actor->GetIndex(), PISTOL_BODYHIT); } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 76833794c..21ec55cc4 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -291,7 +291,7 @@ SKIPWALLCHECK: { continue; } - fi.checkhitsprite(act2->GetIndex(), actor->GetIndex()); + fi.checkhitsprite(act2, actor); } } else if (spri2->extra >= 0 && act2 != actor && (badguy(act2) || spri2->picnum == QUEBALL || spri2->picnum == RRTILE3440 || spri2->picnum == STRIPEBALL || (spri2->cstat & 257) || spri2->picnum == DUKELYINGDEAD)) @@ -352,7 +352,7 @@ SKIPWALLCHECK: if (spri2->picnum == STATUEFLASH || spri2->picnum == QUEBALL || spri2->picnum == STRIPEBALL || spri2->picnum == RRTILE3440) - fi.checkhitsprite(act2->GetIndex(), actor->GetIndex()); + fi.checkhitsprite(act2, actor); if (spri2->picnum != RADIUSEXPLOSION && Owner && Owner->s.statnum < MAXSTATUS) @@ -1182,7 +1182,7 @@ static bool weaponhitsprite(DDukeActor *proj, DDukeActor *targ, const vec3_t &ol return true; } - fi.checkhitsprite(targ->GetIndex(), proj->GetIndex()); + fi.checkhitsprite(targ, proj); if (targ->s.picnum == APLAYER) { @@ -2807,7 +2807,7 @@ static int henstand(DDukeActor *actor) else if (coll.type == kHitSprite) { auto hitact = coll.actor; - fi.checkhitsprite(actor->GetIndex(), hitact->GetIndex()); + fi.checkhitsprite(actor, hitact); if (hitact->s.picnum == HEN) { auto ns = spawn(hitact, HENSTAND); diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index aeb0e759e..0e61eeb43 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -53,8 +53,8 @@ void checkplayerhurt_d(struct player_struct* p, int j); void checkplayerhurt_r(struct player_struct* p, int j); bool checkhitceiling_d(int sn); bool checkhitceiling_r(int sn); -void checkhitsprite_d(int i, int sn); -void checkhitsprite_r(int i, int sn); +void checkhitsprite_d(DDukeActor* i, DDukeActor* sn); +void checkhitsprite_r(DDukeActor* i, DDukeActor* sn); void checksectors_d(int snum); void checksectors_r(int snum); diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 8bdf9b902..3272714f7 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -81,7 +81,7 @@ struct Dispatcher void (*checkhitwall)(int spr, int dawallnum, int x, int y, int z, int atwith); void (*checkplayerhurt)(struct player_struct* p, int j); bool (*checkhitceiling)(int sn); - void (*checkhitsprite)(int i, int sn); + void (*checkhitsprite)(DDukeActor* i, DDukeActor* sn); void (*checksectors)(int low); bool (*ceilingspace)(int sectnum); diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index c04a96cb0..07581a60d 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -276,7 +276,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) if (hitsprt && hitsprt->s.picnum != ACCESSSWITCH && hitsprt->s.picnum != ACCESSSWITCH2) { - fi.checkhitsprite(hitsprt->GetIndex(), knee->GetIndex()); + fi.checkhitsprite(hitsprt, knee); if (p >= 0) fi.checkhitswitch(p, hitsprt->GetIndex(), 1); } @@ -440,7 +440,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa if (hitact) { - fi.checkhitsprite(hitact->GetIndex(), spark->GetIndex()); + fi.checkhitsprite(hitact, spark); if (hitact->s.picnum == TILE_APLAYER && (ud.coop != 1 || ud.ffire == 1)) { auto jib = spawn(spark, JIBS6); @@ -536,7 +536,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa if (hitact) { - fi.checkhitsprite(hitact->GetIndex(), spark->GetIndex()); + fi.checkhitsprite(hitact, spark); if (hitact->s.picnum != TILE_APLAYER) spawn(spark, SMALLSMOKE); else spark->s.xrepeat = spark->s.yrepeat = 0; @@ -980,7 +980,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int if (zvel < 0 && (sector[hitsect].ceilingstat & 1) == 0) fi.checkhitceiling(hitsect); } - else if (hitsprt != nullptr) fi.checkhitsprite(hitsprt->GetIndex(), spark->GetIndex()); + else if (hitsprt != nullptr) fi.checkhitsprite(hitsprt, spark); else if (hitwall >= 0 && wall[hitwall].picnum != ACCESSSWITCH && wall[hitwall].picnum != ACCESSSWITCH2) { fi.checkhitwall(spark->GetIndex(), hitwall, hitx, hity, hitz, GROWSPARK); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 9efd1cbe7..08231072c 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -174,7 +174,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, if (hitsprt && hitsprt->s.picnum != ACCESSSWITCH && hitsprt->s.picnum != ACCESSSWITCH2) { - fi.checkhitsprite(hitsprt->GetIndex(), wpn->GetIndex()); + fi.checkhitsprite(hitsprt, wpn); if (p >= 0) fi.checkhitswitch(p, hitsprt->GetIndex(), 1); } else if (hitwall >= 0) @@ -341,7 +341,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa { if (hitsprt->s.picnum == 1930) return; - fi.checkhitsprite(hitsprt->GetIndex(), spark->GetIndex()); + fi.checkhitsprite(hitsprt, spark); if (hitsprt->s.picnum == TILE_APLAYER && (ud.coop != 1 || ud.ffire == 1)) { auto l = spawn(spark, JIBS6); @@ -441,7 +441,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa if (hitsprt) { - fi.checkhitsprite(hitsprt->GetIndex(), spark->GetIndex()); + fi.checkhitsprite(hitsprt, spark); if (hitsprt->s.picnum != TILE_APLAYER) spawn(spark, SMALLSMOKE); else spark->s.xrepeat = spark->s.yrepeat = 0; diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 7f84440ec..4d7de5a92 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1486,11 +1486,6 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) } } -void checkhitsprite_d(int targ, int proj) -{ - checkhitsprite_d(&hittype[targ], &hittype[proj]); -} - //--------------------------------------------------------------------------- // // diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 59528d754..e6be24bb8 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -2417,11 +2417,6 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) } } -void checkhitsprite_r(int targ, int proj) -{ - checkhitsprite_r(&hittype[targ], &hittype[proj]); -} - //--------------------------------------------------------------------------- // //