forked from Mirrors/openclonk
Fix some failsafeties in HUD when controlling non-Clonk crew objects
parent
e157b1b673
commit
56f985a017
|
@ -223,12 +223,12 @@ func UpdateInventory()
|
|||
}
|
||||
|
||||
// update hand-indicator
|
||||
if(c->IsCarryingHeavy())
|
||||
if(c->~IsCarryingHeavy())
|
||||
{
|
||||
carryheavy->SetSelected(-1);
|
||||
}
|
||||
else
|
||||
for(var i=0; i < c->HandObjects(); ++i)
|
||||
for(var i=0; i < c->~HandObjects(); ++i)
|
||||
{
|
||||
var handpos = c->GetHandItemPos(i);
|
||||
if(inventory[handpos])
|
||||
|
@ -248,6 +248,7 @@ func SetProgressBarLinkForObject(object what, proplist e)
|
|||
// Removes it if it's nil
|
||||
func OnCarryHeavyChange(object obj)
|
||||
{
|
||||
if (!carryheavy) return; // safety if called during construction/destruction process
|
||||
carryheavy->SetSymbol(obj);
|
||||
|
||||
if(obj == nil)
|
||||
|
|
|
@ -231,7 +231,7 @@ public func UpdateBreathBar()
|
|||
if(!crew) return;
|
||||
var phys = crew->GetMaxBreath();
|
||||
var promille;
|
||||
if(phys == 0) promille = 0;
|
||||
if(!phys) promille = 0;
|
||||
else promille = 1000 * crew->GetBreath() / phys;
|
||||
|
||||
// remove breath bar if full breath
|
||||
|
|
Loading…
Reference in New Issue