Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 13, 2005, 11:16:33 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: merged the Trunk into the physics Branche again:
merged with command:
svn merge ../trunk physics -r 3953:HEAD
no important conflicts

Location:
orxonox/branches/physics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics

    • Property svn:externals
      •  

        old new  
        1 data http://svn.orxonox.ethz.ch/data
         1
  • orxonox/branches/physics/src/world_entities/weapon.cc

    r3953 r4178  
    110110void WeaponManager::nextWeaponConf()
    111111{
    112   PRINTF(4)("Changing weapon configuration: from %i\n", this->currConfID);
    113 
    114   Weapon* w;
    115   for(int i = 0; i < W_MAX_SLOTS; ++i)
    116     {
    117       w = this->configs[this->currConfID].slots[i];
    118       if( w != NULL) w->deactivate();
    119     }
    120   int i;
     112  PRINTF(4)("Changing weapon configuration: from %i to next\n", this->currConfID);
     113
     114  int i, lastConfID;
     115  lastConfID = this->currConfID;
    121116  for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
    122117  if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0;
    123118  else this->currConfID = i; 
    124   PRINTF(4)("\tto %i\n", this->currConfID);
    125 
    126   for(int i = 0; i < W_MAX_SLOTS; ++i)
    127     {
    128       w = this->configs[this->currConfID].slots[i];
    129       if( w != NULL) w->activate();
     119
     120 
     121  Weapon *w1, *w2;
     122  for(int j = 0; j < W_MAX_SLOTS; ++j)
     123    {
     124      w1 = this->configs[lastConfID].slots[j];
     125      w2 = this->configs[this->currConfID].slots[j];
     126     
     127      if( w1 == w2)
     128        {
     129          printf("no need for change\n");
     130        }
     131      else
     132        {
     133        if( w1 != NULL )
     134          {
     135            w1->deactivate();
     136            printf("deactivating %i,%i\n", j,lastConfID);
     137          }
     138        if( w2 != NULL)
     139          {
     140            w2->activate();
     141            printf("activating %i,%i\n", j, this->currConfID);
     142          }
     143        }
    130144    }
    131145}
Note: See TracChangeset for help on using the changeset viewer.