Fix some failsafeties in HUD when controlling non-Clonk crew objects

stable-5.4
Sven Eberhardt 2013-12-30 02:11:48 +01:00
parent e157b1b673
commit 56f985a017
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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