- Changed A_SpawnItem and A_SpawnItemEx to take the caller's floatbob into account when calculating the spawned actor's z.

SVN r3790 (trunk)
This commit is contained in:
Randy Heit 2012-07-27 02:01:36 +00:00
parent eea532ce48
commit 97372c9c05

View file

@ -1806,7 +1806,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItem)
AActor * mo = Spawn( missile, AActor * mo = Spawn( missile,
self->x + FixedMul(distance, finecosine[self->angle>>ANGLETOFINESHIFT]), self->x + FixedMul(distance, finecosine[self->angle>>ANGLETOFINESHIFT]),
self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]), self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]),
self->z - self->floorclip + zheight, ALLOW_REPLACE); self->z - self->floorclip + self->GetBobOffset() + zheight, ALLOW_REPLACE);
int flags = (transfer_translation? SIXF_TRANSFERTRANSLATION:0) + (useammo? SIXF_SETMASTER:0); int flags = (transfer_translation? SIXF_TRANSFERTRANSLATION:0) + (useammo? SIXF_SETMASTER:0);
bool res = InitSpawnedItem(self, mo, flags); bool res = InitSpawnedItem(self, mo, flags);
@ -1875,7 +1875,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx)
xvel = newxvel; xvel = newxvel;
} }
AActor * mo = Spawn(missile, x, y, self->z - self->floorclip + zofs, ALLOW_REPLACE); AActor * mo = Spawn(missile, x, y, self->z - self->floorclip + self->GetBobOffset() + zofs, ALLOW_REPLACE);
bool res = InitSpawnedItem(self, mo, flags); bool res = InitSpawnedItem(self, mo, flags);
ACTION_SET_RESULT(res); // for an inventory item's use state ACTION_SET_RESULT(res); // for an inventory item's use state
if (mo) if (mo)