Skip to content

Commit

Permalink
Merge pull request #7 from mysy00/price
Browse files Browse the repository at this point in the history
Add GetItemTypePrice and a forward for GetItemTypeMaxHitPoints
  • Loading branch information
Southclaws authored Nov 21, 2022
2 parents 20e30b3 + a9d9227 commit af95058
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions item.inc
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,18 @@ forward bool:IsItemTypeLongPickup(ItemType:itemtype);
Returns true if the item requires holding the pick-up key in order to pick up.
*/

forward GetItemTypeMaxHitPoints(ItemType:itemtype);
/*
# Description
Returns the max hit points of an item type.
*/

forward GetItemTypePrice(ItemType:itemtype);
/*
# Description
Returns the price of an item type.
*/

forward bool:IsItemDestroying(Item:id);
/*
# Description
Expand Down Expand Up @@ -1798,6 +1810,15 @@ stock GetItemTypeMaxHitPoints(ItemType:itemtype) {
return itm_TypeData[itemtype][itm_maxHitPoints];
}

// itm_price
stock GetItemTypePrice(ItemType:itemtype) {
if(!IsValidItemType(itemtype)) {
return 0;
}

return itm_TypeData[itemtype][itm_price];
}

// itm_Destroying
stock bool:IsItemDestroying(Item:id) {
if(!Iter_Contains(itm_Index, _:id)) {
Expand Down

0 comments on commit af95058

Please sign in to comment.