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

Fix fireworks on non-finite regions crashing the server #1065

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

Pablete1234
Copy link
Member

Fixes a critical issue that crashes the server when trying to spawn fireworks for infinite regions, because they try to spawn at integer-limit x coordinate, and the server has a hard time finding bounding boxes there.

This was caused by a subtle change to behavior on getOpenSpace above, which returned the block's location instead of the location with a different Y, causing a Location with x=Infinity (a double) to turn into x=int limit (block.getLocation()'s result).

This has been fixed in 3 different ways:

  • The radius to spawn fireworks will now ignore Y offset (eg: rectangle). Just because the region is taller shouldn't mean fireworks spawn further away.
  • If even ignoring Y offset, radius is still infinite, it won't even try to spawn fireworks.
  • The original location will be used (modifying just the y's location, to the center of the open space block)

The changes have been tested across several gamemodes (ctw, dtc, dtm, ctf, cp) and work as intended.

@Pablete1234 Pablete1234 added bug Something isn't working urgent Breaks the plugin labels Oct 4, 2022
@Electroid Electroid merged commit 19255a7 into dev Oct 4, 2022
@Electroid Electroid deleted the firework-fixes branch October 4, 2022 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working urgent Breaks the plugin
Development

Successfully merging this pull request may close these issues.

2 participants