Skip to content

fix issue #2675#2677

Open
mumencoder wants to merge 1 commit into
OpenDreamProject:masterfrom
mumencoder:fix/2675-number-resource-equality
Open

fix issue #2675#2677
mumencoder wants to merge 1 commit 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.

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