Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2010, 4:42:57 AM (14 years ago)
Author:
landauf
Message:

merged dynamicmatch to presentation3

Location:
code/branches/presentation3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc

    r6502 r7031  
    3434#include "worldentities/pawns/TeamBaseMatchBase.h"
    3535#include "gametypes/TeamDeathmatch.h"
     36#include "gametypes/Dynamicmatch.h"
    3637#include "controllers/WaypointPatrolController.h"
    3738
     
    245246        }
    246247
     248        Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype);
     249        if (dynamic)
     250        {
     251            if (dynamic->notEnoughPigs||dynamic->notEnoughKillers||dynamic->notEnoughChasers) {return false;}
     252
     253            if (entity1->getPlayer())
     254                team1 = dynamic->getParty(entity1->getPlayer());
     255
     256            if (entity2->getPlayer())
     257                team2 = dynamic->getParty(entity2->getPlayer());
     258
     259            if (team1 ==-1 ||team2 ==-1 ) {return false;}
     260            else if (team1 == dynamic->chaser && team2 != dynamic->chaser) {return false;}
     261            else if (team1 == dynamic->piggy && team2 == dynamic->chaser) {return false;}
     262            else if (team1 == dynamic->killer && team2 == dynamic->chaser) {return false;}
     263            else return true;
     264        }
     265
    247266        return (team1 == team2 && team1 != -1);
    248267    }
Note: See TracChangeset for help on using the changeset viewer.