Skip to content

Comments

Adds an exception to 'turn()' on invalid direction types#2371

Merged
wixoaGit merged 3 commits intoOpenDreamProject:masterfrom
dallaszzz:doin-stuff
Aug 27, 2025
Merged

Adds an exception to 'turn()' on invalid direction types#2371
wixoaGit merged 3 commits intoOpenDreamProject:masterfrom
dallaszzz:doin-stuff

Conversation

@dallaszzz
Copy link
Contributor

Fixes #2352

I tried testing by inverting the if and it looks like its working.

@boring-cyborg boring-cyborg bot added the Runtime Involves the OpenDream server/runtime label Aug 23, 2025
Copy link
Contributor

@Kapu1178 Kapu1178 left a comment

Choose a reason for hiding this comment

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

This is not parity with byond.

Byond allows the second argument (the dir argument) to be anything. This can have an exception implemented as an Optional Exception.

The linked issue was actually referring to the first argument, which only allows "turnable" things like numbers and matrices.

@wixoaGit
Copy link
Member

The first argument is the Dir argument. Angle is the second.

@Kapu1178
Copy link
Contributor

The first argument is the Dir argument. Angle is the second.

FUCK nevermind

@dallaszzz
Copy link
Contributor Author

I don't really know why my code is failing the tests but I think the test is passing a bad argument and triggering the exception. I don't know how tests work so I'll have to look into it later.

@wixoaGit
Copy link
Member

It's failing on line 59 of the turn.dm test. This says it's supposed to return a random direction, but my testing in BYOND gives a bad turn error. Maybe the behavior changed in an update.

@dallaszzz
Copy link
Contributor Author

It's failing on line 59 of the turn.dm test. This says it's supposed to return a random direction, but my testing in BYOND gives a bad turn error. Maybe the behavior changed in an update.

So this means the test should be changed then?

@wixoaGit
Copy link
Member

So this means the test should be changed then?

Yes, it's not testing for correct behavior anymore

@github-actions github-actions bot added size/S and removed size/XS labels Aug 27, 2025
@dallaszzz
Copy link
Contributor Author

This should be ready to review now

@wixoaGit wixoaGit enabled auto-merge (squash) August 27, 2025 15:55
@wixoaGit wixoaGit disabled auto-merge August 27, 2025 18:00
@wixoaGit wixoaGit merged commit 2fd613f into OpenDreamProject:master Aug 27, 2025
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Runtime Involves the OpenDream server/runtime size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

turn() should throw on non-dir types it cannot turn.

3 participants