Slight cleanup in the cInventory / cItemGrid API

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1504 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-05-24 09:16:09 +00:00
parent cf87169737
commit 90e0656c75
6 changed files with 239 additions and 41 deletions
+18
View File
@@ -346,6 +346,15 @@ int cItemGrid::ChangeSlotCount(int a_SlotNum, int a_AddToCount)
int cItemGrid::ChangeSlotCount(int a_X, int a_Y, int a_AddToCount)
{
return ChangeSlotCount(GetSlotNum(a_X, a_Y), a_AddToCount);
}
int cItemGrid::HowManyItems(const cItem & a_Item)
{
int res = 0;
@@ -443,6 +452,15 @@ bool cItemGrid::DamageItem(int a_SlotNum, short a_Amount)
bool cItemGrid::DamageItem(int a_X, int a_Y, short a_Amount)
{
return DamageItem(GetSlotNum(a_X, a_Y), a_Amount);
}
void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, int a_CountLootProbabs, int a_NumSlots, int a_Seed)
{
// Calculate the total weight: