Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2011, 11:49:36 PM (12 years ago)
Author:
jo
Message:

check to prevent crashes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2011/src/modules/overlays/hud/HUDEnemyHealthBar.cc

    r8987 r8995  
    119119
    120120                // get mouse position
    121                 currentYaw = dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController())->getCurrentYaw();
    122                 currentPitch = dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController())->getCurrentPitch();
    123 
     121                if(this->getOwner() && dynamic_cast<ControllableEntity*>(this->getOwner())->getController() && dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController()))
     122                {
     123                    currentYaw = dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController())->getCurrentYaw();
     124                    currentPitch = dynamic_cast<NewHumanController*>(dynamic_cast<ControllableEntity*>(this->getOwner())->getController())->getCurrentPitch();
     125                }
    124126                // Compare cursor position to object position
    125127                if ( fabs(pos.x - currentYaw) < sens_ && fabs(pos.y - currentPitch) < sens_ )
Note: See TracChangeset for help on using the changeset viewer.