Skip to content

Fix unimplemented == operations - #2677

Merged
wixoaGit merged 3 commits into
OpenDreamProject:masterfrom
mumencoder:fix/2675-number-resource-equality
Aug 12, 2026
Merged

Fix unimplemented == operations#2677
wixoaGit merged 3 commits into
OpenDreamProject:masterfrom
mumencoder:fix/2675-number-resource-equality

Conversation

@mumencoder

Copy link
Copy Markdown
Contributor

Fixes #2675

Problem

Comparing a number with a resource (e.g. 0 == 'sound/weapons/metalhit.ogg')
threw NotImplementedException: Equal comparison for 0 and '...' is not implemented
at runtime instead of evaluating to FALSE.

Fix

In DM, values of different types are never ==-equal, so each inner switch now
falls back to return false (mirroring the existing DreamResource/Appearance
branches) instead of throwing. This covers the whole class of cross-type
comparisons, and != / ~= inherit the fix since they route through IsEqual.

@boring-cyborg boring-cyborg Bot added the Runtime Involves the OpenDream server/runtime label Jul 24, 2026
@wixoaGit

wixoaGit commented Jul 25, 2026

Copy link
Copy Markdown
Member

In DM, values of different types are never ==-equal

If this is true then you could replace all these switches with an if (first.Type != second.Type) return false; early on in the method.

@wixoaGit wixoaGit changed the title fix issue #2675 Fix unimplemented == operations Jul 27, 2026
@wixoaGit
wixoaGit enabled auto-merge (squash) August 12, 2026 18:02
@wixoaGit
wixoaGit merged commit 241e2d4 into OpenDreamProject:master Aug 12, 2026
21 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/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unimplemented == comparison between numbers and resources

3 participants