diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index c1b22e000..d1f5e34ac 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -4261,7 +4261,9 @@ ACTOR_STATIC void G_MoveActors(void) s->ang = ps->ang; if ((TEST_SYNC_KEY(g_player[p].sync->bits, SK_FIRE) || (ps->quick_kick > 0)) && sprite[ps->i].extra > 0) - if (ps->quick_kick > 0 || (ps->curr_weapon != HANDREMOTE_WEAPON && ps->curr_weapon != HANDBOMB_WEAPON && ps->curr_weapon != TRIPBOMB_WEAPON && ps->ammo_amount[ps->curr_weapon] >= 0)) + if (ps->quick_kick > 0 || + (PWEAPON(p, ps->curr_weapon, WorksLike) != HANDREMOTE_WEAPON && PWEAPON(p, ps->curr_weapon, WorksLike) != HANDBOMB_WEAPON && + PWEAPON(p, ps->curr_weapon, WorksLike) != TRIPBOMB_WEAPON && ps->ammo_amount[ps->curr_weapon] >= 0)) { for (x=0; x<8; x++) { diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 229dfbe3a..7664a4ac4 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2059,14 +2059,14 @@ static void G_DrawStatusBar(int32_t snum) G_DrawAltDigiNum(105,-(hudoffset-22),lAmount,-16,10+16+256); } - i = (p->curr_weapon == PISTOL_WEAPON) ? 16384 : 32768; + i = (tilesiz[ammo_sprites[p->curr_weapon]].y > 50) ? 16384 : 32768; rotatesprite_althudr(57,hudoffset-15,sbarsc(i),0,ammo_sprites[p->curr_weapon],0,0,10+512); - if (p->curr_weapon == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; + if (PWEAPON(snum, p->curr_weapon, WorksLike) == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; else i = p->curr_weapon; - if (p->curr_weapon != KNEE_WEAPON && + if (PWEAPON(snum, p->curr_weapon, WorksLike) != KNEE_WEAPON && (!althud_flashing || totalclock&32 || p->ammo_amount[i] > (p->max_ammo_amount[i]/10))) G_DrawAltDigiNum(-20,-(hudoffset-22),p->ammo_amount[i],-16,10+16+512); @@ -2155,7 +2155,7 @@ static void G_DrawStatusBar(int32_t snum) rotatesprite_fs(sbarx(37), yofssh+sbary(200-28), sb16, 0, AMMOBOX, 0, 21, orient); - if (p->curr_weapon == HANDREMOTE_WEAPON) + if (PWEAPON(snum, p->curr_weapon, WorksLike) == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; else i = p->curr_weapon; @@ -2379,9 +2379,9 @@ static void G_DrawStatusBar(int32_t snum) if (u&1024) { if (u != -1) G_PatchStatusBar(196,SBY+17,219,SBY+17+11); - if (p->curr_weapon != KNEE_WEAPON) + if (PWEAPON(snum, p->curr_weapon, WorksLike) != KNEE_WEAPON) { - if (p->curr_weapon == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; + if (PWEAPON(snum, p->curr_weapon, WorksLike) == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; else i = p->curr_weapon; G_DrawDigiNum(230-22,SBY+17,p->ammo_amount[i],-16,10+16); } diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 87ad37b60..2293c8cd4 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -842,7 +842,7 @@ static void P_AddWeaponAmmoCommon(DukePlayer_t *ps, int32_t weap, int32_t amount { P_AddAmmo(weap, ps, amount); - if (ps->curr_weapon == KNEE_WEAPON && (ps->gotweapon & (1 << weap))) + if (PWEAPON(vm.g_p, ps->curr_weapon, WorksLike) == KNEE_WEAPON && (ps->gotweapon & (1 << weap))) P_AddWeaponMaybeSwitch(ps, weap); } @@ -3483,7 +3483,7 @@ nullquote: j = 1; else if ((l&256) && s <= -8 && TEST_SYNC_KEY(g_player[vm.g_p].sync->bits, SK_RUN)) j = 1; - else if ((l&512) && (ps->quick_kick > 0 || (ps->curr_weapon == KNEE_WEAPON && ps->kickback_pic > 0))) + else if ((l&512) && (ps->quick_kick > 0 || (PWEAPON(vm.g_p, ps->curr_weapon, WorksLike) == KNEE_WEAPON && ps->kickback_pic > 0))) j = 1; else if ((l&1024) && sprite[ps->i].xrepeat < 32) j = 1; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 13df5b482..2e319eef5 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -943,7 +943,7 @@ static void resetprestat(int32_t snum,int32_t g) P_ResetWeapons(snum); P_ResetInventory(snum); } - else if (p->curr_weapon == HANDREMOTE_WEAPON) + else if (PWEAPON(snum, p->curr_weapon, WorksLike) == HANDREMOTE_WEAPON) { p->ammo_amount[HANDBOMB_WEAPON]++; p->curr_weapon = HANDBOMB_WEAPON; diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index c6360948c..fe4cbc879 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2400,7 +2400,7 @@ void P_HandleSharedKeys(int32_t snum) p->return_to_center = 9; if (TEST_SYNC_KEY(sb_snum, SK_QUICK_KICK) && p->quick_kick == 0) - if (p->curr_weapon != KNEE_WEAPON || p->kickback_pic == 0) + if (PWEAPON(snum, p->curr_weapon, WorksLike) != KNEE_WEAPON || p->kickback_pic == 0) { if (VM_OnEvent(EVENT_QUICKKICK,g_player[snum].ps->i,snum, -1, 0) == 0) {