Minor changes to ModuleRestockLinkedMesh

This commit is contained in:
Andrew Cassidy 2019-06-09 09:41:23 -07:00
parent 34b9226218
commit 175c7269e3
No known key found for this signature in database
GPG Key ID: 963017B38FD477A1
2 changed files with 4 additions and 5 deletions

View File

@ -69,9 +69,9 @@ namespace Restock
GameEvents.onEditorVariantApplied.Remove(OnVariantApplied); GameEvents.onEditorVariantApplied.Remove(OnVariantApplied);
} }
public override void OnTargetSet(Part target) public override void OnTargetSet(Part newTarget)
{ {
base.OnTargetSet(target); base.OnTargetSet(newTarget);
UpdateStretch(); UpdateStretch();
} }
@ -87,12 +87,11 @@ namespace Restock
UpdateStretch(); UpdateStretch();
} }
public void OnVariantApplied(Part part, PartVariant variant) public void OnVariantApplied(Part appliedPart, PartVariant variant)
{ {
UpdateStretch(); if (appliedPart == part) UpdateStretch();
} }
// updates the texture stretch to match the pipe object's local scale // updates the texture stretch to match the pipe object's local scale
private void UpdateStretch() private void UpdateStretch()
{ {