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

Move some math operations to SharedOperations #1477

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

wixoaGit
Copy link
Member

@wixoaGit wixoaGit commented Oct 4, 2023

I created a SharedOperations class and moved some math operations to it. This class is meant for operations done by both the compiler and the server, to ensure they give the same results on both.

I also replaced the CompileErrorExceptions used by these math operations with compiler emissions. There's now a FallbackBuiltinArgument emission that defaults to a warning and tells you when an invalid argument is falling back to another value:

/obj/var/foo = cos("invalid")
Warning OD2208 at ...: Invalid value treated as 0, cos(0) will always be 1

@wixoaGit wixoaGit merged commit 5c1e907 into OpenDreamProject:master Oct 13, 2023
4 checks passed
@wixoaGit wixoaGit deleted the shared_operations branch October 13, 2023 00:22
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.

1 participant