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

Makes lights auto-rotate to walls #17261

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RipGrayson
Copy link
Contributor

@RipGrayson RipGrayson commented Mar 1, 2025

About The Pull Request

I did something similar to posters when porting Hybrisa, this PR makes lights automatically rotate to be against a wall if their rotation would leave them hanging out in the middle of space.

As long as your fixture is properly rotated this PR shouldn't affect you.

Closes #17188

Why It's Good For The Game

Mapper quality of life good, should entirely eliminate mapping errors involving improperly rotated lights, unless they're out in the middle of nowhere with no walls around.

Changelog

🆑
add: Added a system to auto-rotate light fixtures to avoid mapping errors.
/:cl:

@github-actions github-actions bot added Feature New interesting mechanics with new interesting bugs and removed Feature New interesting mechanics with new interesting bugs labels Mar 1, 2025
return
if(isclosedturf(get_turf(loc)))
return
for(var/i in CARDINAL_DIRS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name this something like direction

for(var/i in CARDINAL_DIRS)
if(!isclosedturf(get_step(loc, i)))
continue
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary else

@Lumipharon
Copy link
Contributor

Lumipharon commented Mar 1, 2025

Isn't this adding a bunch of init time stuff for something that should be in the map integration checks or something?
If it's a map error we should detect the error and fix the map, not init time change it every round

@RipGrayson
Copy link
Contributor Author

RipGrayson commented Mar 1, 2025

Isn't this adding a bunch of init time stuff for something that should be in the map integration checks or something? If it's a map error we should detect the error and fix the map, not init time change it every round

Assuming you even could have the integration tests check for walls around every single light in every single map, I'm not sure it would be worth the added check time.

I should really run the profiler and try to see how many seconds of init that this PR adds, but it's probably less than annoying than waiting an additional hour (half hour?) every time you want to run tests because every single light fixture needs checked.

@Lumipharon
Copy link
Contributor

Isn't this adding a bunch of init time stuff for something that should be in the map integration checks or something? If it's a map error we should detect the error and fix the map, not init time change it every round

Assuming you even could have the integration tests check for walls around every single light in every single map, I'm not sure it would be worth the added check time.

I should really run the profiler and try to see how many seconds of init that this PR adds, but it's probably less than annoying than waiting an additional hour (half hour?) every time you want to run tests because every single light fixture needs checked.

It shouldn't add any more time, map checks already load the maps, it would just be reporting a failure if the conditions you've setup get met

@RipGrayson
Copy link
Contributor Author

Isn't this adding a bunch of init time stuff for something that should be in the map integration checks or something? If it's a map error we should detect the error and fix the map, not init time change it every round

Assuming you even could have the integration tests check for walls around every single light in every single map, I'm not sure it would be worth the added check time.
I should really run the profiler and try to see how many seconds of init that this PR adds, but it's probably less than annoying than waiting an additional hour (half hour?) every time you want to run tests because every single light fixture needs checked.

It shouldn't add any more time, map checks already load the maps, it would just be reporting a failure if the conditions you've setup get met

Eh, I'm willing to budge and close this PR if there's a map check that works. I still think this is easier for mappers though, since a non-trivial percentage of them would probably be deeply annoyed at being forced into hunting down lights by coordinate since the checks are yelling at them.

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.

Light fixture is rotated wrong
3 participants