Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Feat: quickloot in cpp (#1400)
Browse files Browse the repository at this point in the history
Co-authored-by: gpedro <[email protected]>
Co-authored-by: FakeShinoda <[email protected]>
  • Loading branch information
3 people authored Aug 25, 2020
1 parent 872de44 commit 89542f8
Show file tree
Hide file tree
Showing 27 changed files with 4,420 additions and 3,440 deletions.
24 changes: 0 additions & 24 deletions data/events/scripts/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,6 @@ function Player:onLook(thing, position, distance)
description = string.format("%s, Unique ID: %d", description, uniqueId)
end

if thing:isContainer() then
local quickLootCategories = {}
local container = Container(thing.uid)
for categoryId = LOOT_START, LOOT_END do
if container ~= nil then
if container:hasQuickLootCategory(categoryId) then
table.insert(quickLootCategories, categoryId)
end
end
end

description = string.format("%s, QuickLootCategory: (%s)", description, table.concat(quickLootCategories, ", "))
end

local itemType = thing:getType()

local transformEquipId = itemType:getTransformEquipId()
Expand Down Expand Up @@ -436,16 +422,6 @@ function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder,

-- Handle move items to the ground
if toPosition.x ~= CONTAINER_POSITION then
if item:isContainer() then
local container = Container(item.uid)
for categoryId = LOOT_START, LOOT_END do
if container:hasQuickLootCategory(categoryId) then
container:removeQuickLootCategory(categoryId)
self:setQuickLootBackpack(categoryId, nil)
end
end
end

return true
end

Expand Down
Loading

0 comments on commit 89542f8

Please sign in to comment.