Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9583


Ignore:
Timestamp:
Mar 26, 2013, 3:30:12 PM (12 years ago)
Author:
smerkli
Message:

Added a check when dying to find another pawn in the
same formation

Location:
code/branches/formationupdate/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/formationupdate/src/orxonox/controllers/FormationController.h

    r9348 r9583  
    9898      virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
    9999
     100      /* Just for testing purposes: report the master. */
     101      FormationController* getMaster( void ) { return myMaster_; }
     102
    100103  protected:
    101104      bool formationFlight_;
     
    159162
    160163      void setTarget(Pawn* target);
     164
    161165      void searchNewTarget();
    162166      void forgetTarget();
  • code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc

    r9555 r9583  
    4747#include "weaponsystem/WeaponSet.h"
    4848
     49#include "controllers/FormationController.h"
     50
    4951namespace orxonox
    5052{
     
    308310    void Pawn::death()
    309311    {
     312        /* TEST TEST This is used to find out if the current pawn is also
     313         * the master of the formulation.
     314         *
     315         * NOTE: This does not yet check if the current pawn is actually
     316         *       the humanplayer or not!
     317         */
     318        for (ObjectList<FormationController>::iterator it =
     319          ObjectList<FormationController>::begin();
     320          it != ObjectList<FormationController>::end(); ++it )
     321        {
     322          orxout(user_warning) << "Test! Master: " << it->getMaster()
     323            << " My controller: " << this->getPlayer()->getController() << endl;
     324        }
     325        /* TEST TEST */
     326
     327           
     328
     329
    310330        this->setHealth(1);
    311331        if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
Note: See TracChangeset for help on using the changeset viewer.