Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6421 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 6, 2006, 7:11:34 PM (19 years ago)
Author:
rennerc
Message:

ParamPowerUp now syncs state correctly
fixed a bug in worldEntity

Location:
branches/network/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/power_ups/param_power_up.cc

    r6420 r6421  
    129129  SYNCHELP_READ_FKT( PowerUp::writeState );
    130130
     131  int i;
     132  SYNCHELP_READ_INT( i );
     133  this->type = (EnumParamPowerUpType)i;
     134  SYNCHELP_READ_INT( this->value );
     135
     136  if ( this->value != 0 )
     137  {
     138    SYNCHELP_READ_INT( this->min_value );
     139    SYNCHELP_READ_INT( this->max_value );
     140  }
     141
    131142  return SYNCHELP_READ_N;
    132143}
     
    151162    SYNCHELP_WRITE_FKT( PowerUp::readState );
    152163
     164    int i = this->type;
     165    SYNCHELP_WRITE_INT( i );
     166    SYNCHELP_WRITE_INT( this->value );
     167
     168    if ( this->value != 0 )
     169    {
     170      SYNCHELP_WRITE_INT( this->min_value );
     171      SYNCHELP_WRITE_INT( this->max_value );
     172    }
     173
    153174    return SYNCHELP_WRITE_N;
    154175  }
  • branches/network/src/world_entities/world_entity.cc

    r6419 r6421  
    4949
    5050  this->obbTree = NULL;
     51
     52  this->md2TextureFileName = NULL;
    5153
    5254  if (root != NULL)
     
    384386  SYNCHELP_READ_FLOAT( scaling );
    385387  //check if modelFileName is relative to datadir or absolute
    386   if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) )
    387   {
    388     loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling );
    389   }
    390   else
    391   {
    392     loadModel( modelFileName, scaling );
     388
     389  if ( strcmp(modelFileName, "") )
     390  {
     391
     392    if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) )
     393   {
     394     loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling );
     395   }
     396    else
     397   {
     398     loadModel( modelFileName, scaling );
     399   }
    393400  }
    394401  delete[] modelFileName;
     402
     403  SYNCHELP_READ_STRINGM( modelFileName );
     404  if ( strcmp(modelFileName, "") )
     405    this->md2TextureFileName = modelFileName;
    395406
    396407  return SYNCHELP_READ_N;
     
    411422  SYNCHELP_WRITE_STRING( getModel( 0 )->getName() );
    412423  SYNCHELP_WRITE_FLOAT( scaling );
     424  if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") )
     425  {
     426    SYNCHELP_WRITE_STRING(this->md2TextureFileName);
     427  }
     428  else
     429  {
     430    SYNCHELP_WRITE_STRING("");
     431  }
     432
    413433  return SYNCHELP_WRITE_N;
    414434}
Note: See TracChangeset for help on using the changeset viewer.