Skip to content

Commit

Permalink
make desc nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
TobleroneSwordfish committed Dec 18, 2024
1 parent b82d31c commit 6107459
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion OpenDreamRuntime/AtomManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public void SetAppearanceVar(IconAppearance appearance, string varName, DreamVal
break;
case "desc":
value.TryGetValueAsString(out var desc);
appearance.Desc = desc ?? string.Empty;
appearance.Desc = desc;
break;
case "icon":
if (_resourceManager.TryLoadIcon(value, out var icon)) {
Expand Down Expand Up @@ -393,6 +393,8 @@ public DreamValue GetAppearanceVar(IconAppearance appearance, string varName) {
case "name":
return new(appearance.Name);
case "desc":
if (appearance.Desc == null)
return DreamValue.Null;
return new(appearance.Desc);
case "icon":
if (appearance.Icon == null)
Expand Down
2 changes: 1 addition & 1 deletion OpenDreamShared/Dream/IconAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class IconAppearance : IEquatable<IconAppearance> {
public static readonly IconAppearance Default = new();

[ViewVariables] public string Name = string.Empty;
[ViewVariables] public string Desc = string.Empty;
[ViewVariables] public string? Desc = string.Empty;
[ViewVariables] public int? Icon;
[ViewVariables] public string? IconState;
[ViewVariables] public AtomDirection Direction = AtomDirection.South;
Expand Down

0 comments on commit 6107459

Please sign in to comment.