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

createBuilding optional arguments not handled correctly #3738

Open
1 task done
Proxy-99 opened this issue Sep 19, 2024 · 7 comments · May be fixed by #3782
Open
1 task done

createBuilding optional arguments not handled correctly #3738

Proxy-99 opened this issue Sep 19, 2024 · 7 comments · May be fixed by #3782
Labels
bug Something isn't working

Comments

@Proxy-99
Copy link
Contributor

Proxy-99 commented Sep 19, 2024

Describe the bug

doing code below will throw error for arg 5 expect vector get none

Steps to reproduce

createBuilding ( 3534, -2412.30884, -601.68127, 132.56250)
or
createBuilding ( 3534, -2412.30884, -601.68127, 132.56250,90) without rz or ry gives error

Version

No response

Additional context

No response

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@Proxy-99 Proxy-99 added the bug Something isn't working label Sep 19, 2024
@TracerDS
Copy link
Contributor

TracerDS commented Sep 19, 2024

createBuilding expects 7 parameters
image

Providing just the model and position works though

@Proxy-99
Copy link
Contributor Author

createBuilding expects 7 parameters image

Providing just the model and position works though

but doing createBuilding ( 3534, -2412.30884, -601.68127, 132.56250,90,0) will break it xd

@TracerDS
Copy link
Contributor

createBuilding expects 7 parameters image
Providing just the model and position works though

but doing createBuilding ( 3534, -2412.30884, -601.68127, 132.56250,90,0) will break it xd

because you need to provide full vector

@Proxy-99
Copy link
Contributor Author

createBuilding expects 7 parameters image
Providing just the model and position works though

but doing createBuilding ( 3534, -2412.30884, -601.68127, 132.56250,90,0) will break it xd

because you need to provide full vector

we should correct it anyway if not ry given it should be set 0 as for createObject does

@TracerDS
Copy link
Contributor

we should correct it anyway if not ry given it should be set 0 as for createObject does

Then we should use x,y,z instead of CVector

@Proxy-99
Copy link
Contributor Author

we should correct it anyway if not ry given it should be set 0 as for createObject does

Then we should use x,y,z instead of CVector

we still could use vectors but handled them in a correct way

if you look for

CClientObject* CStaticFunctionDefinitions::CreateObject(CResource& Resource, unsigned short usModelID, const CVector& vecPosition, const CVector& vecRotation,       bool bLowLod)

@TracerDS
Copy link
Contributor

CStaticFunctionDefinitions::CreateObject is a terrible example.
CVector is already constructed when you call CreateObject, whereas in createBuilding it is being constructed when calling the function from lua.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants