mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
get all fields, not just non-private
This commit is contained in:
parent
7064cbb793
commit
c6c475c344
@ -221,7 +221,10 @@ namespace Mirror.Weaver
|
||||
{
|
||||
foreach (FieldDefinition field in typeDefinition.Fields)
|
||||
{
|
||||
if (field.IsStatic || field.IsPrivate)
|
||||
if (field.IsStatic)
|
||||
continue;
|
||||
|
||||
if (field.HasCustomAttribute<System.Runtime.CompilerServices.CompilerGeneratedAttribute>())
|
||||
continue;
|
||||
|
||||
if (field.IsNotSerialized)
|
||||
|
@ -314,7 +314,7 @@ namespace Mirror.Weaver
|
||||
MethodDefinition ctor = Resolvers.ResolveDefaultPublicCtor(variable);
|
||||
if (ctor == null)
|
||||
{
|
||||
Log.Error($"{variable.Name} can't be deserialized because it has no default constructor. Don't use {variable.Name} in [SyncVar]s, Rpcs, Cmds, etc.", variable);
|
||||
// Log.Error($"{variable.Name} can't be deserialized because it has no default constructor. Don't use {variable.Name} in [SyncVar]s, Rpcs, Cmds, etc.", variable);
|
||||
// WeavingFailed = true;
|
||||
// return;
|
||||
var resolvedVariable = variable.Resolve();
|
||||
@ -323,7 +323,6 @@ namespace Mirror.Weaver
|
||||
var ctorWorker = ctor.Body.GetILProcessor();
|
||||
ctorWorker.Emit(OpCodes.Ret);
|
||||
resolvedVariable.Methods.Add(ctor);
|
||||
Log.Warning("created empty default ctor", variable);
|
||||
}
|
||||
|
||||
MethodReference ctorRef = assembly.MainModule.ImportReference(ctor);
|
||||
|
Loading…
Reference in New Issue
Block a user