mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Reverts 00f982cb89.
Reverts b40413dfd6.
Decorates EntityPrototype.Name with CanBeNull.
The entity spawn window now properly handles prototypes with null names. Previously, a null name would throw a NullException. Entities with null names will never show up in the spawn window search results.
This commit is contained in:
@@ -239,6 +239,11 @@ namespace Robust.Client.UserInterface.CustomControls
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(prototype.Name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (prototype.Name.ToLowerInvariant().Contains(searchStr))
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.Interfaces.Reflection;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Maths;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -40,8 +38,8 @@ namespace Robust.Shared.GameObjects
|
||||
/// <summary>
|
||||
/// The "in game name" of the object. What is displayed to most players.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
[ViewVariables, CanBeNull]
|
||||
public string Name { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The description of the object that shows upon using examine
|
||||
@@ -377,7 +375,7 @@ namespace Robust.Shared.GameObjects
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(target.Name))
|
||||
if (target.Name == null)
|
||||
{
|
||||
target.Name = source.Name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user