Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 17, 2009, 12:49:29 PM (16 years ago)
Author:
scheusso
Message:

some optimisations (mostly inlined SynchronisableVariable functions)
trying to track down a bug with enet connections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp/src/orxonox/objects/controllers/AIController.cc

    r2662 r2794  
    101101    void AIController::tick(float dt)
    102102    {
    103         if (!this->isActive())
    104             return;
    105 
    106         if (this->target_)
    107             this->aimAtTarget();
    108 
    109         if (this->bHasTargetPosition_)
    110             this->moveToTargetPosition(dt);
    111 
    112         if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
    113             this->getControllableEntity()->fire(WeaponMode::fire);
     103        if(Core::isMaster())
     104        {
     105            if (!this->isActive())
     106                return;
     107   
     108            if (this->target_)
     109                this->aimAtTarget();
     110   
     111            if (this->bHasTargetPosition_)
     112                this->moveToTargetPosition(dt);
     113   
     114            if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
     115                this->getControllableEntity()->fire(WeaponMode::fire);
     116        }
    114117
    115118        SUPER(AIController, tick, dt);
Note: See TracChangeset for help on using the changeset viewer.