Skip to content

Commit

Permalink
Revert "- Duke: Restore a little bit of original code to make compari…
Browse files Browse the repository at this point in the history
…sons between us and the source easier."

This reverts commit 7607190.

* Not good in hindsight... We need the actual value from the backend to ensure we can match up against `WeaponSel_Next`/`WeaponSel_Prev`/`WeaponSel_Alt` as required.
  • Loading branch information
mjr4077au committed Jul 17, 2021
1 parent 4ee93de commit bcff74f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/games/duke/src/inlines.h
Expand Up @@ -136,7 +136,7 @@ inline void PlayerSetInput(int pl, ESyncBits bit)

inline int PlayerNewWeapon(int pl)
{
return ps[pl].sync.getNewWeapon() - 1;
return ps[pl].sync.getNewWeapon();
}

inline void PlayerSetItemUsed(int pl, int num)
Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/input.cpp
Expand Up @@ -243,8 +243,8 @@ void hud_input(int plnum)
}

int weap = PlayerNewWeapon(plnum);
if (weap > 0 && p->kickback_pic > 0)
p->wantweaponfire = weap;
if (weap > 1 && p->kickback_pic > 0)
p->wantweaponfire = weap - 1;

// Here we have to be extra careful that the weapons do not get mixed up, so let's keep the code for Duke and RR completely separate.
fi.selectweapon(plnum, weap);
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/player_d.cpp
Expand Up @@ -1299,7 +1299,7 @@ void selectweapon_d(int snum, int weap) // playernum, weaponnum
}
}
}
else j = weap;
else j = weap - 1;

k = -1;

Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/player_r.cpp
Expand Up @@ -1071,7 +1071,7 @@ void selectweapon_r(int snum, int weap)
}
}
}
else j = weap;
else j = weap - 1;

k = -1;

Expand Down

0 comments on commit bcff74f

Please sign in to comment.