Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2007, 5:59:39 PM (18 years ago)
Author:
nicolasc
Message:

xfer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc

    r10675 r10678  
    165165  this->secWeaponMan.setSlotCount(6);
    166166
    167   this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    168   this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    169   this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    170   this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    171   this->weaponMan.createWeaponSlot(4, 1.635, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    172   this->weaponMan.createWeaponSlot(5, 1.536, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    173   this->weaponMan.createWeaponSlot(6, 1.536, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    174   this->weaponMan.createWeaponSlot(7, 1.536, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    175 
    176 
    177   this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");
    178   this->weaponMan.addWeaponToSlot(0, 1, "RFCannon");
    179   this->weaponMan.addWeaponToSlot(0, 2, "RFCannon");
    180   this->weaponMan.addWeaponToSlot(0, 3, "RFCannon");
    181   this->weaponMan.addWeaponToSlot(1, 0, "RFCannon");
    182   this->weaponMan.addWeaponToSlot(1, 1, "RFCannon");
    183   this->weaponMan.addWeaponToSlot(1, 2, "RFCannon");
    184   this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");
     167//   this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     168//   this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     169//   this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     170//   this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     171//   this->weaponMan.createWeaponSlot(4, 1.635, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     172//   this->weaponMan.createWeaponSlot(5, 1.536, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     173//   this->weaponMan.createWeaponSlot(6, 1.536, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     174//   this->weaponMan.createWeaponSlot(7, 1.536, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     175
     176
     177//   this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");
     178//   this->weaponMan.addWeaponToSlot(0, 1, "RFCannon");
     179//   this->weaponMan.addWeaponToSlot(0, 2, "RFCannon");
     180//   this->weaponMan.addWeaponToSlot(0, 3, "RFCannon");
     181//   this->weaponMan.addWeaponToSlot(1, 0, "RFCannon");
     182//   this->weaponMan.addWeaponToSlot(1, 1, "RFCannon");
     183//   this->weaponMan.addWeaponToSlot(1, 2, "RFCannon");
     184//   this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");
    185185
    186186  this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser");
     
    452452{
    453453
    454 //   if( !this->bInit)
    455 //   {
    456 //     // now get slots from the mount points
    457 //     std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();
    458 //     for( ;it != this->mountPointMap.end(); it++)
    459 //     {
    460 //       WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());
    461 //       if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))
    462 //       {
    463 //         int slot = ws->getWeaponSlot();
    464 // //         int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right)
    465 //         this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());
    466 //         this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
    467 // //         PRINTF(0)("setting slot %i\n", slot);
    468 // //         (*it).second->getCenter().debug();
    469 //       }
    470 //     }
    471 //   this->bInit = true;
    472 //   }
     454  if( !this->bInit)
     455  {
     456    // now get slots from the mount points
     457    std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();
     458    for( ;it != this->mountPointMap.end(); it++)
     459    {
     460      WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());
     461      if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))
     462      {
     463        int slot = ws->getWeaponSlot();
     464//         int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right)
     465        this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());
     466        this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
     467//         PRINTF(0)("setting slot %i\n", slot);
     468//         (*it).second->getCenter().debug();
     469      }
     470    }
     471  this->bInit = true;
     472  }
    473473
    474474  // Playable::tick(time);
Note: See TracChangeset for help on using the changeset viewer.