Skip to content

chore: disable interacting with doors if ped is in any vehicle#156

Merged
thelindat merged 2 commits into
overextended:mainfrom
SeaLife:main
Aug 14, 2024
Merged

chore: disable interacting with doors if ped is in any vehicle#156
thelindat merged 2 commits into
overextended:mainfrom
SeaLife:main

Conversation

@SeaLife

@SeaLife SeaLife commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

Hey,

we'r about to use ox_target on our Server and i'd like to use those defaults for simple vehicle interactions. We just found out, that you can interact with other vehicles even if your driving/sitting in yet another vehicle. I think this is not the desired behaviour and therefore should be changed.

If this change will not be merged, its fine by us, we will probably just copy the implementation, deactive the defaults and add those restriction on our own. But we think, everyone using the default should profit from this change, as it improves the immersivity. ☺️

Have a greate day,
SeaLife

Comment thread client/defaults.lua Outdated
---@return boolean?
local function canInteractWithDoor(entity, coords, door, useOffset)
if not GetIsDoorValid(entity, door) or GetVehicleDoorLockStatus(entity) > 1 or IsVehicleDoorDamaged(entity, door) then return end
if not GetIsDoorValid(entity, door) or GetVehicleDoorLockStatus(entity) > 1 or IsVehicleDoorDamaged(entity, door) or IsPedInAnyVehicle(PlayerPedId(), false) then return end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just cache.vehicle will suffice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified the code so it uses cache.vehicle, thanks :)

@thelindat thelindat merged commit ca1583e into overextended:main Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants