Fixed GluedComponent interactions with metamorphic glasses (#24943)
* Only rename if name matches reconstructed * Rearranged query Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Okay --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -77,13 +77,16 @@ public sealed class GlueSystem : SharedGlueSystem
|
|||||||
{
|
{
|
||||||
base.Update(frameTime);
|
base.Update(frameTime);
|
||||||
|
|
||||||
var query = EntityQueryEnumerator<GluedComponent, UnremoveableComponent>();
|
var query = EntityQueryEnumerator<GluedComponent, UnremoveableComponent, MetaDataComponent>();
|
||||||
while (query.MoveNext(out var uid, out var glue, out _))
|
while (query.MoveNext(out var uid, out var glue, out var _, out var meta))
|
||||||
{
|
{
|
||||||
if (_timing.CurTime < glue.Until)
|
if (_timing.CurTime < glue.Until)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_metaData.SetEntityName(uid, glue.BeforeGluedEntityName);
|
// Instead of string matching, just reconstruct the expected name and compare
|
||||||
|
if (meta.EntityName == Loc.GetString("glued-name-prefix", ("target", glue.BeforeGluedEntityName)))
|
||||||
|
_metaData.SetEntityName(uid, glue.BeforeGluedEntityName);
|
||||||
|
|
||||||
RemComp<UnremoveableComponent>(uid);
|
RemComp<UnremoveableComponent>(uid);
|
||||||
RemComp<GluedComponent>(uid);
|
RemComp<GluedComponent>(uid);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user