Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 3dbeb5f

Browse files
committed
fix(server): nil plate in entity mismatch
See #1856.
1 parent 20b1e40 commit 3dbeb5f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/shops/server.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ local function createShop(shopType, id)
9191
coords = store
9292
end
9393

94-
---@type OxShop
9594
shop[id] = {
9695
label = shop.name,
9796
id = shopType..' '..id,

server.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ local function openInventory(source, invType, data, ignoreSecurityChecks)
161161
if right and data.netid ~= right.netid then
162162
local invEntity = NetworkGetEntityFromNetworkId(right.netid)
163163

164-
if DoesEntityExist(invEntity) or plate and not string.match(GetVehicleNumberPlateText(invEntity), plate) then return end
164+
if invEntity > 0 and DoesEntityExist(invEntity) or plate and not string.match(GetVehicleNumberPlateText(invEntity) or '', plate) then
165+
return
166+
end
165167

166168
Inventory.Remove(right)
167169
right = Inventory(data)

0 commit comments

Comments
 (0)