Skip to content

Commit

Permalink
refactor(entityCreated): split return condition
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-michalak authored Aug 30, 2024
1 parent 87095ee commit 3d305f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ AddEventHandler('entityCreated', function (entity)
local type = GetEntityType(entity)
local isPed = type == EntityType.Ped
local isVehicle = type == EntityType.Vehicle
if not (isPed or isVehicle) then return end
if not isPed and not isVehicle then return end
local vehicle = isPed and GetVehiclePedIsIn(entity, false) or entity

if not DoesEntityExist(vehicle) then return end -- ped can be not in vehicle, so we need to check if vehicle is a entity, otherwise it will return 0
Expand Down

0 comments on commit 3d305f8

Please sign in to comment.