mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
Bug fix: double reload
This commit is contained in:
1 parent
24ced381de
commit
4042fb3a62
1 file changed
+9
-3
+9
-3
@@ -1291,13 +1291,19 @@ Gfx *lvRender(Gfx *gdl)
|
||||
|
||||
// Handle opening doors and reloading
|
||||
if (g_Vars.currentplayer->bondactivateorreload & JO_ACTION_RELOAD) {
|
||||
if (g_Vars.currentplayer->hands[HAND_RIGHT].state != HANDSTATE_RELOAD){
|
||||
struct hand* hand = &g_Vars.currentplayer->hands[HAND_RIGHT];
|
||||
struct weaponfunc* func = weaponGetFunction(&hand->gset, hand->gset.weaponfunc);
|
||||
// ignore the player's request to reload here if the last bullet in the clip was just fired
|
||||
if (hand->state != HANDSTATE_RELOAD && !(hand->state == HANDSTATE_ATTACK && hand->loadedammo[func->ammoindex] == 0)) {
|
||||
bgunReloadIfPossible(HAND_RIGHT);
|
||||
|
||||
}
|
||||
if (g_Vars.currentplayer->hands[HAND_LEFT].state != HANDSTATE_RELOAD) {
|
||||
|
||||
hand = &g_Vars.currentplayer->hands[HAND_LEFT];
|
||||
func = weaponGetFunction(&hand->gset, hand->gset.weaponfunc);
|
||||
if (hand->state != HANDSTATE_RELOAD && !(hand->state == HANDSTATE_ATTACK && hand->loadedammo[func->ammoindex] == 0)) {
|
||||
bgunReloadIfPossible(HAND_LEFT);
|
||||
}
|
||||
|
||||
g_Vars.currentplayer->bondactivateorreload = (g_Vars.currentplayer->bondactivateorreload & ~JO_ACTION_RELOAD) | (g_Vars.currentplayer->bondactivateorreload & 0x0);
|
||||
}
|
||||
if (g_Vars.currentplayer->bondactivateorreload & JO_ACTION_ACTIVATE) {
|
||||
|
||||
Reference in new issue
Block a user