File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -444,11 +444,26 @@ void CTFLunchBox::ApplyBiteEffects( CTFPlayer *pPlayer )
444444 {
445445 int maxPrimary = pPlayer->GetMaxAmmo (TF_AMMO_PRIMARY);
446446 int iAmmoGiven = pPlayer->GiveAmmo (maxPrimary * 0.25 , TF_AMMO_PRIMARY, true );
447- if (iAmmoGiven > 0 )
447+ if (iAmmoGiven > 0 && !pPlayer-> IsBot () )
448448 {
449449 bDrainAmmo = true ;
450450 }
451451 }
452+
453+ #if defined(QUIVER_DLL) || defined(QUIVER_CLIENT_DLL)
454+ // Restore armor if applicable
455+ if (nLunchBoxType == LUNCHBOX_ADDS_ARMOR)
456+ {
457+ int oldArmor = pPlayer->ArmorValue ();
458+ int maxArmor = pPlayer->GetMaxArmor ();
459+ pPlayer->IncrementArmorValue (maxArmor * 0.25 , maxArmor);
460+ int iArmorGiven = (pPlayer->ArmorValue () - oldArmor);
461+ if (iArmorGiven > 0 && !pPlayer->IsBot ())
462+ {
463+ bDrainAmmo = true ;
464+ }
465+ }
466+ #endif
452467 }
453468
454469 // Drain ammo on the first bite that applied an effect
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ enum lunchbox_weapontypes_t
2727 LUNCHBOX_ADDS_AMMO,
2828 LUNCHBOX_BANANA,
2929 LUNCHBOX_FISHCAKE,
30+ #if defined(QUIVER_DLL) || defined(QUIVER_CLIENT_DLL)
31+ LUNCHBOX_ADDS_ARMOR,
32+ #endif
3033};
3134
3235#define TF_SANDWICH_REGENTIME 30
You can’t perform that action at this time.
0 commit comments