Fix InstrumentSystem.Update exception when deleting band lead (#42331)

This commit is contained in:
B_Kirill
2026-01-27 01:52:56 +10:00
committed by GitHub
parent 5b9ff83ce5
commit 093257280b

View File

@@ -438,20 +438,22 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
if (Deleted(master))
{
Clean(uid, instrument);
continue;
}
var masterActive = activeQuery.CompOrNull(master);
if (masterActive == null)
{
Clean(uid, instrument);
continue;
}
var trans = transformQuery.GetComponent(uid);
var masterTrans = transformQuery.GetComponent(master);
if (!_transform.InRange(masterTrans.Coordinates, trans.Coordinates, 10f)
)
if (!_transform.InRange(masterTrans.Coordinates, trans.Coordinates, 10f))
{
Clean(uid, instrument);
continue;
}
}