Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetEntityHealth occasionally fails on build 2802 #2135

Closed
MatinHQ opened this issue Aug 1, 2023 · 3 comments
Closed

SetEntityHealth occasionally fails on build 2802 #2135

MatinHQ opened this issue Aug 1, 2023 · 3 comments

Comments

@MatinHQ
Copy link

MatinHQ commented Aug 1, 2023

Hello it appears SetEntityHealth occasionally breaks on game build 2802

Error executing native 0x6b76dc1f3ae6e6a3 at address FiveM_b2802_GTAProcess.exe+15EB7A5

@thelindat
Copy link
Contributor

Hijacking this issue since I discussed this with somebody recently; I'll just quote them.

SET_ENTITY_HEALTH actually takes a third argument, [...] I wouldn't be surprised if the OAL bits aren't zeroing out enough (or any) arguments.

It'd probably be better to update to codegen script to zero out the next X fields (instead of just memsetting the LuaNativeContext on initialization).

Related: 2e0018b
I assume this would also resolve https://forum.cfx.re/t/lua-oal-script-loses-entity-ownership-after-using-detachentity/5007847/2?

@blattersturm
Copy link
Contributor

blattersturm commented Aug 3, 2023

Ideally we'd have argument declarations that include newly-added/default parameters, as some native commands get updated to add default parameters that aren't 0 (I think there was a -1 or -2 somewhere). The well-known .sch files for example contain this information up to a certain point, but they're questionable for obvious reasons.

Zeroing out the 'next few' could be a viable workaround for OAL however, indeed.

(Though, I wonder if the issue author actually is using OAL since they're just mentioning 'occasionally' and not providing any other context...)

@MatinHQ
Copy link
Author

MatinHQ commented Aug 3, 2023

Hello, I am using OAL and I didn't mention that because I thought it couldn't be related (as I changed my server build recently I thought it might be the issue) and for further context

I have no clue how this happens sometimes it just fails for example when I heal player or make the entity health decrease because of hunger or...

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

No branches or pull requests

3 participants