Skip to content

Commit

Permalink
fix helper logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Feb 18, 2025
1 parent d13ab54 commit f59b7f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OpenDreamRuntime/Procs/DMOpcodeHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,11 @@ private static DreamValue TypecheckHelper(DreamValue typeValue, DreamValue value
}

if (value.TryGetValueAsDreamObject(out var dreamObject) && dreamObject != null) {
return doCast ? new DreamValue(dreamObject) : new DreamValue(dreamObject.IsSubtypeOf(type) ? 1 : 0);
if (dreamObject.IsSubtypeOf(type)) {
return doCast ? new DreamValue(dreamObject) : DreamValue.True;
}

return nullOrFalse;
}

return nullOrFalse;
Expand Down

0 comments on commit f59b7f9

Please sign in to comment.