Skip to content

Commit 4dd2c9a

Browse files
mikigoaliethelindat
authored andcommitted
fix(inv/client): trunk access if entity is exploded (#46)
* Update client.lua * Update client.lua * Update client.lua
1 parent 47da2e4 commit 4dd2c9a

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

client.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,8 @@ local function registerCommands()
744744
local function openGlovebox(vehicle)
745745
if not IsPedInAnyVehicle(playerPed, false) or not NetworkGetEntityIsNetworked(vehicle) then return end
746746

747+
if IsEntityDead(entity) then return end
748+
747749
local vehicleHash = GetEntityModel(vehicle)
748750
local vehicleClass = GetVehicleClass(vehicle)
749751
local checkVehicle = Vehicles.Storage[vehicleHash]

modules/inventory/client.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ local backDoorIds = { 2, 3 }
5454
function Inventory.CanAccessTrunk(entity)
5555
if cache.vehicle or not NetworkGetEntityIsNetworked(entity) then return end
5656

57+
if IsEntityDead(entity) then return end
58+
5759
local vehicleHash = GetEntityModel(entity)
5860
local vehicleClass = GetVehicleClass(entity)
5961
local checkVehicle = Vehicles.Storage[vehicleHash]

0 commit comments

Comments
 (0)