diff options
Diffstat (limited to 'gamemode/core/inventory')
| -rw-r--r-- | gamemode/core/inventory/sv_invtracker.lua | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/gamemode/core/inventory/sv_invtracker.lua b/gamemode/core/inventory/sv_invtracker.lua index 67e32a1..32388d7 100644 --- a/gamemode/core/inventory/sv_invtracker.lua +++ b/gamemode/core/inventory/sv_invtracker.lua @@ -77,14 +77,6 @@ net.Receive("art_RequestInvDrop",function(len,ply) local frominvid = net.ReadUInt(32) local frompos = net.ReadTable() assert(not froment:IsPlayer() or froment == ply, "Player tried to drop an item that was from another players inventory") - print("Using data for drop:") - PrintTable({ - ["froment"] = froment, - ["frominvid"] = frominvid, - ["frompos"] = frompos - }) - print("Player's data is:") - PrintTable(froment.data) local frominv = froment.data.inventories[frominvid] local item = frominv:Get(frompos) frominv:Remove(frompos) @@ -119,11 +111,8 @@ end --@tparam player ply The player we want to provide the updates to --@tparam number invid The inventory number on the player we want to provide the updates to function track.MakeInventoryObserver(ply,invid) - print("Making observer...") local observer = {} observer.Put = function(self,pos,item) - print("In observer, item was", item) - PrintTable(item) local name = item.Name local data = item:Serialize() net.Start("art_UpdateInventory") @@ -142,7 +131,6 @@ function track.MakeInventoryObserver(ply,invid) net.WriteTable(pos) net.Send(ply) end - print("Returning observer...") return observer end @@ -157,7 +145,6 @@ function track.NotifyPlayerOfInventory(ply,tinv) net.WriteString(tinv.Name) net.WriteUInt(#initaldat,32) net.WriteData(initaldat,#initaldat) - print("Before sending, inv owner is", tinv.Owner, "and type is",tinv.Name) net.WriteEntity(tinv.Owner) net.WriteTable({}) net.Send(ply) @@ -199,18 +186,12 @@ end --@tparam table|nil higharchy The spot in the higharchy to place the inventory. function track.GiveInventoryWithData(ply,name,data,higharchy) local hi = higharchy or {} - print("Giveing inventory with data") local i = inv.CreateInventoryFromData(name,data,ply) - print("Created inventory track",ply,ply.data,ply.data.inventories) local nid = #ply.data.inventories + 1 - print("got nid") local observer = track.MakeInventoryObserver(ply,nid) - print("Made observer for", i) i.id = nid i:AddObserver(observer) - print("Added observer") ply.data.inventories[nid] = i - print("About to tell client to observe") net.Start("art_ObserveInventory") net.WriteUInt(nid,32) net.WriteString(name) @@ -218,11 +199,7 @@ function track.GiveInventoryWithData(ply,name,data,higharchy) net.WriteData(data,#data) net.WriteEntity(ply) net.WriteTable(hi) - print("About to send...") net.Send(ply) - - print("Finished giving inventory with data, ply.data is now ", ply.data) - PrintTable(ply.data) end @@ -249,14 +226,9 @@ end --@tparam table tbl The position the item is in (returned by plymeta:HasItem()) --@treturn itemtbl The item that was removed function plymeta:RemoveItem(tbl) - print("Got remove table, it was",tbl) - PrintTable(tbl) local nid = tbl[1] local pos = tbl[2] - print("Self inventory was") - PrintTable(self.data.inventories[nid]) local item = self.data.inventories[nid]:Remove(pos) - print("sv_invtracker's item was", item) return item end @@ -275,7 +247,6 @@ function plymeta:GiveItem(tbl) log.debug("inventory " .. k .. " couldn't fit it...") end end - PrintTable(tbl) error("Unable to find place to put item") end @@ -288,7 +259,6 @@ end ---Sets a player's credits. -- To be depriciated function plymeta:SetCredits(num) - print("Set credits called") self.data.credits = num net.Start("art_load_player_data") net.WriteTable({ |
