Skip to content

Commit

Permalink
Fix hat (Southclaws#559)
Browse files Browse the repository at this point in the history
* Fix hat

* Update hats.pwn
  • Loading branch information
kolor4do authored May 20, 2021
1 parent 51be2e8 commit cb071e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gamemodes/sss/core/itemtype/hats.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ stock SetPlayerHatItem(playerid, Item:itemid)
if(!GetClothesHatStatus(skinid))
return 0;

if(hat_CurrentHatItem[playerid] == itemid)
return 0;

new model;
GetItemTypeModel(itemtype, model);

Expand All @@ -111,6 +114,10 @@ stock SetPlayerHatItem(playerid, Item:itemid)

RemoveItemFromWorld(itemid);
RemoveCurrentItem(GetItemHolder(itemid));

if(IsValidItem(hat_CurrentHatItem[playerid]))
GiveWorldItemToPlayer(playerid, hat_CurrentHatItem[playerid]);

hat_CurrentHatItem[playerid] = itemid;

return 1;
Expand Down

0 comments on commit cb071e8

Please sign in to comment.