forked from Mirrors/openclonk
Fix line not updating on disconnect
parent
dd99b2c4c3
commit
96468023cf
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue