Skip to content

Commit

Permalink
- Duke: Remove incur_damage() from dispatcher.
Browse files Browse the repository at this point in the history
* Only used locally within `processinput()` for each game.
  • Loading branch information
mjr4077au committed Nov 10, 2023
1 parent 7dbd38c commit f4fee75
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 0 additions & 4 deletions source/games/duke/src/dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ void addweapon_d(DDukePlayer* p, int weapon, bool wswitch);
void addweapon_r(DDukePlayer* p, int weapon, bool wswitch);
int ifhitbyweapon_r(DDukeActor* sn);
int ifhitbyweapon_d(DDukeActor* sn);
void incur_damage_d(DDukePlayer* p);
void incur_damage_r(DDukePlayer* p);
void selectweapon_d(DDukePlayer* const p, int j);
void selectweapon_r(DDukePlayer* const p, int j);
int doincrements_d(DDukePlayer* p);
Expand Down Expand Up @@ -80,7 +78,6 @@ void SetDispatcher()
addweapon_d,
ifhitbyweapon_d,

incur_damage_d,
selectweapon_d,
doincrements_d,
checkweapons_d,
Expand All @@ -102,7 +99,6 @@ void SetDispatcher()
addweapon_r,
ifhitbyweapon_r,

incur_damage_r,
selectweapon_r,
doincrements_r,
checkweapons_r,
Expand Down
1 change: 0 additions & 1 deletion source/games/duke/src/duke3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ struct Dispatcher
int (*ifhitbyweapon)(DDukeActor* sectnum);

// player
void (*incur_damage)(DDukePlayer* p);
void (*selectweapon)(DDukePlayer* const p, int j);
int (*doincrements)(DDukePlayer* p);
void (*checkweapons)(DDukePlayer* p);
Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/player_d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void operateweapon_ww(DDukePlayer* const p, ESyncBits actions);
//
//---------------------------------------------------------------------------

void incur_damage_d(DDukePlayer* p)
static void incur_damage(DDukePlayer* p)
{
const auto pact = p->GetActor();
int damage = 0L, shield_damage = 0L;
Expand Down Expand Up @@ -1597,7 +1597,7 @@ void processinput_d(DDukePlayer* const p)
}


if (pact->spr.extra > 0) fi.incur_damage(p);
if (pact->spr.extra > 0) incur_damage(p);
else
{
pact->spr.extra = 0;
Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/player_r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BEGIN_DUKE_NS
//
//---------------------------------------------------------------------------

void incur_damage_r(DDukePlayer* p)
static void incur_damage(DDukePlayer* p)
{
int damage = 0, shield_damage = 0;
int gut = 0;
Expand Down Expand Up @@ -2419,7 +2419,7 @@ void processinput_r(DDukePlayer* const p)
}


if (pact->spr.extra > 0) fi.incur_damage(p);
if (pact->spr.extra > 0) incur_damage(p);
else
{
pact->spr.extra = 0;
Expand Down

0 comments on commit f4fee75

Please sign in to comment.