weapon zonebuilding fix?

This commit is contained in:
rackover 2021-04-06 21:10:47 +02:00
parent a2c8705868
commit d6394f0c69

View File

@ -274,9 +274,9 @@ namespace Assets
{ {
buffer->align(Utils::Stream::ALIGN_4); buffer->align(Utils::Stream::ALIGN_4);
int* ptrs = buffer->dest<int>(); int* ptrs = buffer->dest<int>();
buffer->saveMax(37 * sizeof(Game::snd_alias_list_t*)); buffer->saveMax(31 * sizeof(Game::snd_alias_list_t*));
for (int i = 0; i < 37; i++) for (int i = 0; i < 31; i++)
{ {
if (!def->bounceSound[i]) if (!def->bounceSound[i])
{ {
@ -433,14 +433,16 @@ namespace Assets
if (def->projExplosionSound) if (def->projExplosionSound)
{ {
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->projExplosionSound->aliasName); buffer->saveString(def->projExplosionSound->aliasName);
Utils::Stream::ClearPointer(&dest->projExplosionSound); Utils::Stream::ClearPointer(&dest->projExplosionSound);
} }
if (def->projDudSound) if (def->projDudSound)
{ {
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->projDudSound->aliasName); buffer->saveString(def->projDudSound->aliasName);
Utils::Stream::ClearPointer(&dest->projDudSound); Utils::Stream::ClearPointer(&dest->projDudSound);
} }
@ -476,7 +478,8 @@ namespace Assets
if (def->projIgnitionSound) if (def->projIgnitionSound)
{ {
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->projIgnitionSound->aliasName); buffer->saveString(def->projIgnitionSound->aliasName);
Utils::Stream::ClearPointer(&dest->projIgnitionSound); Utils::Stream::ClearPointer(&dest->projIgnitionSound);
} }
@ -551,7 +554,8 @@ namespace Assets
if (def->turretOverheatSound) if (def->turretOverheatSound)
{ {
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->turretOverheatSound->aliasName); buffer->saveString(def->turretOverheatSound->aliasName);
Utils::Stream::ClearPointer(&dest->turretOverheatSound); Utils::Stream::ClearPointer(&dest->turretOverheatSound);
} }
@ -569,7 +573,8 @@ namespace Assets
if (def->turretBarrelSpinMaxSnd) if (def->turretBarrelSpinMaxSnd)
{ {
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->turretBarrelSpinMaxSnd->aliasName); buffer->saveString(def->turretBarrelSpinMaxSnd->aliasName);
Utils::Stream::ClearPointer(&dest->turretBarrelSpinMaxSnd); Utils::Stream::ClearPointer(&dest->turretBarrelSpinMaxSnd);
} }
@ -577,7 +582,8 @@ namespace Assets
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (!def->turretBarrelSpinUpSnd[i]) continue; if (!def->turretBarrelSpinUpSnd[i]) continue;
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->turretBarrelSpinUpSnd[i]->aliasName); buffer->saveString(def->turretBarrelSpinUpSnd[i]->aliasName);
Utils::Stream::ClearPointer(&dest->turretBarrelSpinUpSnd[i]); Utils::Stream::ClearPointer(&dest->turretBarrelSpinUpSnd[i]);
} }
@ -585,21 +591,24 @@ namespace Assets
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (!def->turretBarrelSpinDownSnd[i]) continue; if (!def->turretBarrelSpinDownSnd[i]) continue;
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->turretBarrelSpinDownSnd[i]->aliasName); buffer->saveString(def->turretBarrelSpinDownSnd[i]->aliasName);
Utils::Stream::ClearPointer(&dest->turretBarrelSpinDownSnd[i]); Utils::Stream::ClearPointer(&dest->turretBarrelSpinDownSnd[i]);
} }
if (def->missileConeSoundAlias) if (def->missileConeSoundAlias)
{ {
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->missileConeSoundAlias->aliasName); buffer->saveString(def->missileConeSoundAlias->aliasName);
Utils::Stream::ClearPointer(&dest->missileConeSoundAlias); Utils::Stream::ClearPointer(&dest->missileConeSoundAlias);
} }
if (def->missileConeSoundAliasAtBase) if (def->missileConeSoundAliasAtBase)
{ {
buffer->saveMax(4); buffer->align(Utils::Stream::ALIGN_4);
buffer->saveMax(sizeof(Game::snd_alias_list_t*));
buffer->saveString(def->missileConeSoundAliasAtBase->aliasName); buffer->saveString(def->missileConeSoundAliasAtBase->aliasName);
Utils::Stream::ClearPointer(&dest->missileConeSoundAliasAtBase); Utils::Stream::ClearPointer(&dest->missileConeSoundAliasAtBase);
} }