Fix line not updating on disconnect

liquid_container
Mark 2016-03-25 18:51:18 +01:00
parent dd99b2c4c3
commit 96468023cf
2 changed files with 5 additions and 5 deletions

View File

@ -131,8 +131,8 @@ public func GetPipeLength()
private func Destruction()
{
var line_end = GetPipeKit();
if (line_end) line_end->SetNeutralPipe();
if (GetActionTarget(0)) GetActionTarget(0)->~OnPipeLineRemoval();
if (GetActionTarget(1)) GetActionTarget(1)->~OnPipeLineRemoval();
return;
}

View File

@ -53,6 +53,7 @@ public func IsToolProduct() { return true;}
public func OnPipeLineRemoval()
{
SetNeutralPipe();
OnPipeLengthChange();
return;
}
@ -69,9 +70,8 @@ public func OnPipeLengthChange()
// Display the line length bar over the pipe icon.
public func GetInventoryIconOverlay()
{
var pipe = FindObject(Find_ID(PipeLine), Find_Func("IsConnectedTo", this));
if (!pipe)
return;
var pipe = GetConnectedLine();
if (!pipe) return;
var percentage = 100 * pipe->GetPipeLength() / pipe.PipeMaxLength;
var red = percentage * 255 / 100;