Skip to content

Commit

Permalink
Fixed a rare error when selling an item during map change
Browse files Browse the repository at this point in the history
  • Loading branch information
azalty authored and nuclearsilo583 committed Feb 2, 2023
1 parent 67a15a0 commit 652123c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/sourcemod/scripting/store_combine.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4092,7 +4092,10 @@ public void Store_SellItem(int client,int itemid)

g_eClients[client].iCredits += m_iCredits;
//Chat(client, "%t", "Chat Sold Item", g_eItems[itemid].szName, g_eTypeHandlers[g_eItems[itemid].iHandler].szType);
CPrintToChat(client, "%s%t", g_sChatPrefix, "Chat Sold Item", g_eItems[itemid].szName, g_eTypeHandlers[g_eItems[itemid].iHandler].szType);
if (IsClientInGame(client)) // Prevents a rare error case where a restricted item would be auto-sold during a map change
{
CPrintToChat(client, "%s%t", g_sChatPrefix, "Chat Sold Item", g_eItems[itemid].szName, g_eTypeHandlers[g_eItems[itemid].iHandler].szType);
}

Store_UnequipItem(client, itemid);

Expand Down

0 comments on commit 652123c

Please sign in to comment.