--------------------------------------------------------------------------
| 352 | |
| 353 | //-------------------------------------------------------------------------- |
| 354 | void ProjectileData::packData(BitStream* stream) |
| 355 | { |
| 356 | Parent::packData(stream); |
| 357 | |
| 358 | stream->writeString(projectileShapeName); |
| 359 | stream->writeFlag(faceViewer); |
| 360 | if(stream->writeFlag(scale.x != 1 || scale.y != 1 || scale.z != 1)) |
| 361 | { |
| 362 | stream->write(scale.x); |
| 363 | stream->write(scale.y); |
| 364 | stream->write(scale.z); |
| 365 | } |
| 366 | |
| 367 | if (stream->writeFlag(particleEmitter != NULL)) |
| 368 | stream->writeRangedU32(particleEmitter->getId(), DataBlockObjectIdFirst, |
| 369 | DataBlockObjectIdLast); |
| 370 | |
| 371 | if (stream->writeFlag(particleWaterEmitter != NULL)) |
| 372 | stream->writeRangedU32(particleWaterEmitter->getId(), DataBlockObjectIdFirst, |
| 373 | DataBlockObjectIdLast); |
| 374 | |
| 375 | if (stream->writeFlag(explosion != NULL)) |
| 376 | stream->writeRangedU32(explosion->getId(), DataBlockObjectIdFirst, |
| 377 | DataBlockObjectIdLast); |
| 378 | |
| 379 | if (stream->writeFlag(waterExplosion != NULL)) |
| 380 | stream->writeRangedU32(waterExplosion->getId(), DataBlockObjectIdFirst, |
| 381 | DataBlockObjectIdLast); |
| 382 | |
| 383 | if (stream->writeFlag(splash != NULL)) |
| 384 | stream->writeRangedU32(splash->getId(), DataBlockObjectIdFirst, |
| 385 | DataBlockObjectIdLast); |
| 386 | |
| 387 | if (stream->writeFlag(decal != NULL)) |
| 388 | stream->writeRangedU32(decal->getId(), DataBlockObjectIdFirst, |
| 389 | DataBlockObjectIdLast); |
| 390 | |
| 391 | sfxWrite( stream, sound ); |
| 392 | |
| 393 | if ( stream->writeFlag(lightDesc != NULL)) |
| 394 | stream->writeRangedU32(lightDesc->getId(), DataBlockObjectIdFirst, |
| 395 | DataBlockObjectIdLast); |
| 396 | |
| 397 | stream->write(impactForce); |
| 398 | |
| 399 | // stream->writeRangedU32(lifetime, 0, Projectile::MaxLivingTicks); |
| 400 | // stream->writeRangedU32(armingDelay, 0, Projectile::MaxLivingTicks); |
| 401 | // stream->writeRangedU32(fadeDelay, 0, Projectile::MaxLivingTicks); |
| 402 | |
| 403 | // [tom, 3/21/2007] Changing these to write all 32 bits as the previous |
| 404 | // code limited these to a max value of 4095. |
| 405 | stream->write(lifetime); |
| 406 | stream->write(armingDelay); |
| 407 | stream->write(fadeDelay); |
| 408 | |
| 409 | if(stream->writeFlag(isBallistic)) |
| 410 | { |
| 411 | stream->write(gravityMod); |
nothing calls this directly
no test coverage detected