Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

check to prevent crashes.

Location:
code/branches/presentation2011/src
Files:
3 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_ )
  • code/branches/presentation2011/src/orxonox/controllers/FormationController.cc

    r8992 r8995  
    4040#include "gametypes/TeamDeathmatch.h"
    4141#include "gametypes/Dynamicmatch.h"
    42 #include "gametypes/Mission.h" TODO: include mission after merging
     42#include "gametypes/Mission.h"
    4343#include "gametypes/Gametype.h"
    4444#include "controllers/WaypointPatrolController.h"
     
    8989        this->speedCounter_ = 0.2f;
    9090        this->targetPosition_ = Vector3::ZERO;
    91         //this->team_=-1;
     91        this->team_=-1;
    9292        this->target_.setCallback(createFunctor(&FormationController::targetDied, this));
    9393  }
  • code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc

    r8980 r8995  
    311311    void TeamGametype::colourPawn(Pawn* pawn, int teamNr)
    312312    {// catch no-colouring-case and wrong input
    313         if(teamNr < 0 || pawn == NULL) return;
     313        if(teamNr < 0 || teamNr+1 > this->teamcolours_.size() ||pawn == NULL) return;
    314314        pawn->setRadarObjectColour(this->teamcolours_[teamNr]);
    315315
Note: See TracChangeset for help on using the changeset viewer.