Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10512 in orxonox.OLD for trunk/src/world_entities/npcs


Ignore:
Timestamp:
Jan 30, 2007, 8:01:19 PM (17 years ago)
Author:
bknecht
Message:

some changes so the vertical scroller will work better

Location:
trunk/src/world_entities/npcs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/npc.cc

    r10511 r10512  
    6565                        ->addMethod("fire", Executor0<NPC, lua_State*>(&NPC::fire))
    6666                        ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack))
     67                        ->addMethod("setAI", Executor1<NPC, lua_State*, bool>(&NPC::setAI))
    6768                        ->addMethod("setVisibility", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::setVisibility))
    6869                       );
     
    234235//   LoadParamXML(root, "Weapons", this, NPC, addWeapons)
    235236//   .describe("creates and adds weapons");
     237}
     238
     239void NPC::setAI(bool activate)
     240{
     241     if(activate) AIEngine::getInstance()->addAI(teamNumber,swarmNumber,(WorldEntity*)this,maxSpeed,attackDistance);
     242     else AIEngine::getInstance()->removeAI(teamNumber,swarmNumber,(WorldEntity*)this);
    236243}
    237244
  • trunk/src/world_entities/npcs/npc.h

    r10499 r10512  
    3333  inline int getTeam()  { return teamNumber; }
    3434  inline void fire(){ this->bFire=true;}
    35 
     35  void setAI(bool activate);
    3636  inline void enableAI(int flag) { this->bAIEnabled = (bool)flag; }
    3737
Note: See TracChangeset for help on using the changeset viewer.