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

round shot logic #3795

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

round shot logic #3795

wants to merge 3 commits into from

Conversation

benlp91
Copy link
Contributor

@benlp91 benlp91 commented Jan 2, 2025

No description provided.

@benlp91 benlp91 marked this pull request as draft January 2, 2025 20:10
@benlp91 benlp91 marked this pull request as ready for review January 2, 2025 20:10
@@ -126,6 +126,7 @@ const struct NamedCommand magic_shot_commands[] = {
{"SPEEDDEVIATION", 58},
{"SPREAD_XY", 59},
{"SPREAD_Z", 60},
{"SPREAD_CIRCULAR", 60},
Copy link
Member

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

n++;

// Generate random position within a circle for XY
float angle = ((float)rand() / RAND_MAX) * 2 * M_PI; // Random angle between 0 and 2π
Copy link
Member

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.

Copy link
Contributor

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

@benlp91 benlp91 marked this pull request as draft January 2, 2025 20:39
@benlp91 benlp91 marked this pull request as ready for review January 2, 2025 20:40
shotst->spread_circular = k; // Set the value for combined scattering
n++;

// Generate random position within a circle for XY
Copy link
Contributor

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.

@xtremeqg xtremeqg closed this Jan 21, 2025
@xtremeqg xtremeqg deleted the round-shot-logic branch January 21, 2025 07:30
@xtremeqg xtremeqg restored the round-shot-logic branch January 21, 2025 10:18
@xtremeqg xtremeqg reopened this Jan 21, 2025
@walt253 walt253 marked this pull request as draft January 21, 2025 10:48
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.

4 participants