From 3f7bf88e30aa493c81795e0a1a79962ea081c030 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Tue, 27 Jun 2017 08:14:30 -0500 Subject: Updated cItemGrid API docs to reflect required GetInventory() calls. --- Server/Plugins/APIDump/APIDesc.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index 324c7503d..fb6dc44ec 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -7420,7 +7420,8 @@ This class represents a 2D array of items. It is used as the underlying storage The following code tries to add 32 sticks to a player's main inventory:
 local Items = cItem(E_ITEM_STICK, 32);
-local PlayerMainInventory = Player:GetInventorySlots();  -- PlayerMainInventory is of type cItemGrid
+local PlayerInventory = Player:GetInventory();
+local PlayerMainInventory = PlayerInventory:GetInventoryGrid();  -- PlayerMainInventory is of type cItemGrid
 local NumAdded = PlayerMainInventory:AddItem(Items);
 if (NumAdded == Items.m_ItemCount) then
   -- All the sticks did fit
@@ -7437,7 +7438,8 @@ end
 					Contents = [[
 						The following code damages the helmet in the player's armor and destroys it if it reaches max damage:
 
-local PlayerArmor = Player:GetArmorSlots();  -- PlayerArmor is of type cItemGrid
+local PlayerInventory = Player:GetInventory();
+local PlayerArmor = PlayerInventory:GetArmorGrid();  -- PlayerArmor is of type cItemGrid
 if (PlayerArmor:DamageItem(0)) then  -- Helmet is at SlotNum 0
   -- The helmet has reached max damage, destroy it:
   PlayerArmor:EmptySlot(0);
-- 
cgit v1.2.3