Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 23, 2009, 5:00:54 PM (15 years ago)
Author:
scheusso
Message:

merge old netp branch to netp2 (still because of multiplayer pong…)

Location:
code/branches/netp2/src/orxonox/objects
Files:
2 edited

Legend:

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

    r2662 r2836  
    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);
  • code/branches/netp2/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2826 r2836  
    129129        this->firehack_ = 0x0;
    130130
    131         if (this->health_ <= 0)
     131        if (Core::isMaster())
     132          if (this->health_ <= 0)
    132133            this->death();
    133134    }
Note: See TracChangeset for help on using the changeset viewer.