Changeset 10546 in orxonox.OLD for trunk/src/world_entities/npcs
- Timestamp:
- Jan 31, 2007, 5:44:06 AM (18 years ago)
- Location:
- trunk/src/world_entities/npcs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/npc.cc
r10545 r10546 195 195 196 196 197 // now get slots from the mount points198 std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();199 for( ;it != this->mountPointMap.end(); it++)200 {201 WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());202 if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))203 {204 int slot = ws->getWeaponSlot();205 int side = ws->getWeaponSide();206 this->getWeaponManager().setSlotPosition(slot, ws->getRelCoor());207 this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());208 PRINTF(0)("setting slot %i\n", slot);209 }210 }211 197 212 198 this->getWeaponManager().getFixedTarget()->setParent(this); 213 199 this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0); 200 this->bInit = false; 214 201 } 215 202 … … 411 398 void NPC::tick(float dt) 412 399 { 400 if( !this->bInit) 401 { 402 // now get slots from the mount points 403 std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin(); 404 for( ;it != this->mountPointMap.end(); it++) 405 { 406 WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount()); 407 if( ws != NULL && ws->isA(WeaponSlot::staticClassID())) 408 { 409 int slot = ws->getWeaponSlot(); 410 int side = ws->getWeaponSide(); 411 this->getWeaponManager().setSlotPosition(slot, ws->getRelCoor()); 412 this->getWeaponManager().setSlotDirection(slot, ws->getRelDir()); 413 PRINTF(0)("setting slot %i\n", slot); 414 ws->getRelCoor().debug(); 415 } 416 } 417 this->bInit = true; 418 } 419 420 421 413 422 this->weaponMan.tick(dt); 414 423 if (this->bFire) -
trunk/src/world_entities/npcs/npc.h
r10545 r10546 57 57 WeaponManager weaponMan; //!< weapon manager 58 58 bool bFire; //!< fire 59 bool bInit; 59 60 60 61 AIModule* aiModule;
Note: See TracChangeset
for help on using the changeset viewer.