Skip to content

Commit

Permalink
fix(modules/lib): set entity orphan mode on spawned vehicles to impro…
Browse files Browse the repository at this point in the history
…ve vehicle persistence (#639)
  • Loading branch information
Manason authored Dec 7, 2024
1 parent e61c4c0 commit 23bb76e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ if isServer then
error('unable to successfully spawn vehicle after 3 attempts')
end

--- prevent server from deleting a vehicle without an owner
SetEntityOrphanMode(veh, 2)
exports.qbx_core:EnablePersistence(veh)
return netId, veh
end
Expand Down

0 comments on commit 23bb76e

Please sign in to comment.