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

Save coords for player can be wrong #152

Open
CeebDev opened this issue Jul 9, 2024 · 2 comments
Open

Save coords for player can be wrong #152

CeebDev opened this issue Jul 9, 2024 · 2 comments

Comments

@CeebDev
Copy link
Contributor

CeebDev commented Jul 9, 2024

I dont have a repro, but sometimes x, y maybe z ? Can miss the point in database

So a coord like x = 355.4234 y = 2344.3553 z = 34.42

can be x = 355.4234 y = 23443553 z = 34.42 in database

Completely random coords, don't go here idk if it's a real coord, that's just a example

So this lead to crash on the switch when player try to select char
I didn't have checked the code behind yet but i will state this here

@CeebDev
Copy link
Contributor Author

CeebDev commented Jul 27, 2024

image

@CeebDev
Copy link
Contributor Author

CeebDev commented Jul 27, 2024

My code in #getSaveData() function
I have added toFixed to avoid having this problems but this continue to happen so it's coming from the GetEntityCoords

let coords = GetEntityCoords(this.ped);
let heading = GetEntityHeading(this.ped);
// Let's make max 3 decimals for coords and 2 for heading
coords = coords.map((v) => parseFloat(v.toFixed(3)));
heading = parseFloat(heading.toFixed(3));
return [
	...coords,
	heading,

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

1 participant