-
Notifications
You must be signed in to change notification settings - Fork 81
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
round shot logic #3795
base: master
Are you sure you want to change the base?
round shot logic #3795
Conversation
src/config_magic.c
Outdated
@@ -126,6 +126,7 @@ const struct NamedCommand magic_shot_commands[] = { | |||
{"SPEEDDEVIATION", 58}, | |||
{"SPREAD_XY", 59}, | |||
{"SPREAD_Z", 60}, | |||
{"SPREAD_CIRCULAR", 60}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a unique number
src/config_magic.c
Outdated
n++; | ||
|
||
// Generate random position within a circle for XY | ||
float angle = ((float)rand() / RAND_MAX) * 2 * M_PI; // Random angle between 0 and 2π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not use floats in any code that should remain in sync, and projectiles are certainly among that. No rand() either, use our synced random functions. This will break packetsave and multiplayer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also don't do this on the config :p
shotst->spread_circular = k; // Set the value for combined scattering | ||
n++; | ||
|
||
// Generate random position within a circle for XY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are in the config function, you don't do any logic like this here. This function is only meant to assign a value to variable.
No description provided.