diff --git a/regamedll/dlls/items.cpp b/regamedll/dlls/items.cpp index 9cfa06d0..774e47eb 100644 --- a/regamedll/dlls/items.cpp +++ b/regamedll/dlls/items.cpp @@ -379,10 +379,15 @@ BOOL CItemKevlar::MyTouch(CBasePlayer *pPlayer) return FALSE; #endif +#ifdef REGAMEDLL_FIXES + if (pPlayer->m_iKevlar != ARMOR_NONE && pPlayer->pev->armorvalue >= MAX_NORMAL_BATTERY) + return FALSE; +#endif + if (pPlayer->m_iKevlar == ARMOR_NONE) pPlayer->m_iKevlar = ARMOR_KEVLAR; - pPlayer->pev->armorvalue = 100; + pPlayer->pev->armorvalue = MAX_NORMAL_BATTERY; EMIT_SOUND(pPlayer->edict(), CHAN_ITEM, "items/ammopickup2.wav", VOL_NORM, ATTN_NORM); MESSAGE_BEGIN(MSG_ONE, gmsgItemPickup, nullptr, pPlayer->pev); @@ -390,7 +395,11 @@ BOOL CItemKevlar::MyTouch(CBasePlayer *pPlayer) MESSAGE_END(); MESSAGE_BEGIN(MSG_ONE, gmsgArmorType, nullptr, pPlayer->pev); +#ifdef REGAMEDLL_FIXES + WRITE_BYTE(pPlayer->m_iKevlar == ARMOR_KEVLAR ? 0 : 1); // 0 = ARMOR_KEVLAR, 1 = ARMOR_VESTHELM +#else WRITE_BYTE(0); +#endif MESSAGE_END(); if (TheTutor) @@ -422,8 +431,13 @@ BOOL CItemAssaultSuit::MyTouch(CBasePlayer *pPlayer) return FALSE; #endif +#ifdef REGAMEDLL_FIXES + if (pPlayer->m_iKevlar == ARMOR_VESTHELM && pPlayer->pev->armorvalue >= MAX_NORMAL_BATTERY) + return FALSE; +#endif + pPlayer->m_iKevlar = ARMOR_VESTHELM; - pPlayer->pev->armorvalue = 100; + pPlayer->pev->armorvalue = MAX_NORMAL_BATTERY; EMIT_SOUND(pPlayer->edict(), CHAN_ITEM, "items/ammopickup2.wav", VOL_NORM, ATTN_NORM); @@ -432,7 +446,7 @@ BOOL CItemAssaultSuit::MyTouch(CBasePlayer *pPlayer) MESSAGE_END(); MESSAGE_BEGIN(MSG_ONE, gmsgArmorType, nullptr, pPlayer->pev); - WRITE_BYTE(1); + WRITE_BYTE(1); // 0 = ARMOR_KEVLAR, 1 = ARMOR_VESTHELM MESSAGE_END(); if (TheTutor) diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 2761eb7d..6a05d1ce 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -2323,8 +2323,15 @@ void CArmoury::ArmouryTouch(CBaseEntity *pOther) } case ARMOURY_KEVLAR: { + +#ifdef REGAMEDLL_FIXES + if (pToucher->m_iKevlar != ARMOR_NONE && pToucher->pev->armorvalue >= MAX_NORMAL_BATTERY) +#else if (pToucher->m_iKevlar == ARMOR_KEVLAR) +#endif + { return; + } pToucher->GiveNamedItem("item_kevlar"); m_iCount--; @@ -2332,8 +2339,14 @@ void CArmoury::ArmouryTouch(CBaseEntity *pOther) } case ARMOURY_ASSAULT: { - if (pToucher->m_iKevlar == ARMOR_VESTHELM) + if (pToucher->m_iKevlar == ARMOR_VESTHELM +#ifdef REGAMEDLL_FIXES + && pToucher->pev->armorvalue >= MAX_NORMAL_BATTERY +#endif + ) + { return; + } pToucher->GiveNamedItem("item_assaultsuit"); m_iCount--;