mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix prototype hot reloading.
This commit is contained in:
@@ -305,6 +305,11 @@ namespace Robust.Client.GameObjects
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
// Please somebody burn this to the ground
|
||||
// Fix prototype reload trying to update tree on deserialization dummy instances.
|
||||
if (!Owner.IsValid())
|
||||
return;
|
||||
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
{
|
||||
|
||||
@@ -253,21 +253,27 @@ namespace Robust.Shared.Prototypes
|
||||
}
|
||||
}
|
||||
|
||||
if (nonPushedParent) continue;
|
||||
if (nonPushedParent)
|
||||
continue;
|
||||
|
||||
// TODO DON'T FORGET TO FIX THIS
|
||||
/*foreach (var parent in parents)
|
||||
var parentMaps = new MappingDataNode[parents.Length];
|
||||
for (var i = 0; i < parentMaps.Length; i++)
|
||||
{
|
||||
PushInstanceInheritance(type, id, parent);
|
||||
}*/
|
||||
parentMaps[i] = kindData.Results[parents[i]];
|
||||
}
|
||||
|
||||
kindData.Results[id] = _serializationManager.PushCompositionWithGenericNode(
|
||||
kind,
|
||||
parentMaps,
|
||||
kindData.Results[id]);
|
||||
}
|
||||
|
||||
|
||||
var prototype = TryReadPrototype(kind, id, kindData.Results[id], SerializationHookContext.DontSkipHooks);
|
||||
if (prototype == null)
|
||||
continue;
|
||||
|
||||
kindData.Instances[id] = prototype;
|
||||
if (prototype != null)
|
||||
{
|
||||
kindData.Instances[id] = prototype;
|
||||
}
|
||||
|
||||
pushedSet.Add(id);
|
||||
}
|
||||
@@ -496,14 +502,6 @@ namespace Robust.Shared.Prototypes
|
||||
}
|
||||
}
|
||||
|
||||
private MappingDataNode PushInstanceInheritance(Type type, MappingDataNode result, MappingDataNode[] parents)
|
||||
{
|
||||
return _serializationManager.PushCompositionWithGenericNode(
|
||||
type,
|
||||
parents,
|
||||
result);
|
||||
}
|
||||
|
||||
#endregion IPrototypeManager members
|
||||
|
||||
private void ReloadPrototypeKinds()
|
||||
|
||||
Reference in New Issue
Block a user