File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ static entity_field_alias_t custom_entity_field_alias[] =
134
134
};
135
135
136
136
bool g_bServerActive = false ;
137
+ bool g_bItemCreatedByBuying = false ;
137
138
PLAYERPVSSTATUS g_PVSStatus[MAX_CLIENTS];
138
139
unsigned short m_usResetDecals;
139
140
unsigned short g_iShadowSprite;
@@ -1493,7 +1494,10 @@ void BuyItem(CBasePlayer *pPlayer, int iSlot)
1493
1494
1494
1495
if (pszItem)
1495
1496
{
1497
+ g_bItemCreatedByBuying = true ;
1496
1498
pPlayer->GiveNamedItem (pszItem);
1499
+ g_bItemCreatedByBuying = false ;
1500
+
1497
1501
pPlayer->AddAccount (-iItemPrice, RT_PLAYER_BOUGHT_SOMETHING);
1498
1502
}
1499
1503
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ C_DLLEXPORT int CountTeams();
102
102
C_DLLEXPORT int CountTeamPlayers (int iTeam );
103
103
104
104
extern bool g_bServerActive ;
105
+ extern bool g_bItemCreatedByBuying ;
105
106
extern bool g_skipCareerInitialSpawn ;
106
107
107
108
extern unsigned short m_usResetDecals ;
Original file line number Diff line number Diff line change @@ -371,8 +371,10 @@ void CItemKevlar::Precache()
371
371
BOOL CItemKevlar::MyTouch (CBasePlayer *pPlayer)
372
372
{
373
373
#ifdef REGAMEDLL_ADD
374
- if (pPlayer->HasRestrictItem (ITEM_KEVLAR, ITEM_TYPE_TOUCHED))
374
+ if (!g_bItemCreatedByBuying && pPlayer->HasRestrictItem (ITEM_KEVLAR, ITEM_TYPE_TOUCHED))
375
375
return FALSE ;
376
+
377
+ g_bItemCreatedByBuying = false ;
376
378
#endif
377
379
378
380
#ifdef REGAMEDLL_FIXES
@@ -423,8 +425,10 @@ void CItemAssaultSuit::Precache()
423
425
BOOL CItemAssaultSuit::MyTouch (CBasePlayer *pPlayer)
424
426
{
425
427
#ifdef REGAMEDLL_ADD
426
- if (pPlayer->HasRestrictItem (ITEM_ASSAULT, ITEM_TYPE_TOUCHED))
428
+ if (!g_bItemCreatedByBuying && pPlayer->HasRestrictItem (ITEM_ASSAULT, ITEM_TYPE_TOUCHED))
427
429
return FALSE ;
430
+
431
+ g_bItemCreatedByBuying = false ;
428
432
#endif
429
433
430
434
#ifdef REGAMEDLL_FIXES
You can’t perform that action at this time.
0 commit comments