Skip to content

Commit

Permalink
fix(framework) registration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijmen committed Jul 24, 2023
1 parent 04ae4db commit ac714ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions server/sv_property.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function Property:new(propertyData)
self.property_id = tostring(propertyData.property_id)
self.propertyData = propertyData

local stash = string.format("property_%s", propertyData.property_id)
local stashName = string.format("property_%s", propertyData.property_id)
local stashConfig = Config.Shells[propertyData.shell].stash

Framework[Config.Inventory].RegisterInventory(stash, stashConfig, propertyData.street)
Framework[Config.Inventory].RegisterInventory(stashName, propertyData.street or propertyData.apartment or stashName, stashConfig)

return self
end
Expand Down
16 changes: 8 additions & 8 deletions shared/framework.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ if IsDuplicityVersion() then
TriggerClientEvent('QBCore:Notify', src, message, type)
end

function Framework.ox.RegisterInventory(stash, label, stashConfig)
exports.ox_inventory:RegisterStash(stash, label, stashConfig.slots, stashConfig.maxweight, nil)
end

function Framework.qb.RegisterInventory(stash, label, stashConfig)
-- Used for ox_inventory compat
end

return
end

Expand Down Expand Up @@ -217,10 +225,6 @@ Framework.qb = {
TriggerServerEvent("inventory:server:OpenInventory", "stash", stash, stashConfig)
TriggerEvent("inventory:client:SetCurrentStash", stash)
end,

RegisterInventory = function (stash, stashConfig, label)
-- Used for ox_inventory compat
end,
}

Framework.ox = {
Expand Down Expand Up @@ -398,8 +402,4 @@ Framework.ox = {
OpenInventory = function (stash, stashConfig)
exports.ox_inventory:openInventory('stash', stash)
end,

RegisterInventory = function (stash, stashConfig, label)
exports.ox_inventory:RegisterStash(stash, label, stashConfig.slots, stashConfig.maxweight, nil)
end,
}

0 comments on commit ac714ba

Please sign in to comment.