Fix verbs for children of the component defining the verb.

This fixes clothing not having a pick up verb, for example.
This commit is contained in:
Pieter-Jan Briers
2019-10-10 12:17:17 +02:00
parent 21612794c5
commit 6249a129c0

View File

@@ -1,8 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Utility;
namespace Content.Shared.GameObjects namespace Content.Shared.GameObjects
{ {
@@ -118,7 +118,7 @@ namespace Content.Shared.GameObjects
foreach (var component in entity.GetAllComponents()) foreach (var component in entity.GetAllComponents())
{ {
var type = component.GetType(); var type = component.GetType();
foreach (var nestedType in type.GetNestedTypes(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)) foreach (var nestedType in type.GetAllNestedTypes())
{ {
if (!typeof(Verb).IsAssignableFrom(nestedType) || nestedType.IsAbstract) if (!typeof(Verb).IsAssignableFrom(nestedType) || nestedType.IsAbstract)
{ {