Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2008, 1:01:47 PM (16 years ago)
Author:
landauf
Message:

some spaceshipAI tweaks for network

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/objects/SpaceShipAI.cc

    r1480 r1484  
    6868        for (int i = 4; i <= NUM_AI_TEAMS; ++i)
    6969            this->teamColours_[i] = ColourValue(rnd(), rnd(), rnd(), 1);
    70 
    71         actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
     70    }
     71
     72    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     73    {
     74        SpaceShip::XMLPort(xmlelement, mode);
     75        myShip_=true;
     76
     77        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
    7278    }
    7379
     
    8894            newenemy->setRotDamp(1.0);
    8995            Element xmlelement;
    90             newenemy->create();
     96            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
    9197        }
    9298    }
     
    218224    void SpaceShipAI::searchNewTargetPosition()
    219225    {
    220         this->targetPosition_ += Vector3(rnd(-10000,10000), rnd(-10000,10000), rnd(-10000,10000));
     226        this->targetPosition_ = Vector3(rnd(-5000,5000), rnd(-5000,5000), rnd(-5000,5000));
    221227        this->bHasTargetPosition_ = true;
    222228    }
Note: See TracChangeset for help on using the changeset viewer.