mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Allow AutoNetworkedField to work with inherited datafields (#6090)
* allow AutoNetworkedField to work for inherited datafields * fix * test fix * typo * Update Robust.UnitTesting/Shared/GameState/AutoNetworkingTest.cs --------- Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using static Microsoft.CodeAnalysis.SymbolDisplayFormat;
|
||||
using static Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions;
|
||||
using Robust.Roslyn.Shared;
|
||||
|
||||
// Yes dude I know this source generator isn't incremental, I'll fix it eventually.
|
||||
#pragma warning disable RS1035
|
||||
@@ -48,7 +49,7 @@ namespace Robust.Shared.CompNetworkGenerator
|
||||
var componentName = classSymbol.Name;
|
||||
var stateName = $"{componentName}_AutoState";
|
||||
|
||||
var members = classSymbol.GetMembers();
|
||||
var members = TypeSymbolHelper.GetAllMembersIncludingInherited(classSymbol);
|
||||
var fields = new List<(ITypeSymbol Type, string FieldName)>();
|
||||
var fieldAttr = comp.GetTypeByMetadataName(MemberAttributeName);
|
||||
|
||||
@@ -715,7 +716,7 @@ public partial class {componentName}{deltaInterface}
|
||||
|
||||
if (relevantAttribute == null)
|
||||
{
|
||||
foreach (var mem in typeSymbol.GetMembers())
|
||||
foreach (var mem in TypeSymbolHelper.GetAllMembersIncludingInherited(typeSymbol))
|
||||
{
|
||||
var attribute = mem.GetAttributes().FirstOrDefault(a =>
|
||||
a.AttributeClass != null &&
|
||||
|
||||
Reference in New Issue
Block a user