mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
- fixed: A_Warp didn't initialize oldx/y/z in all situations.
This commit is contained in:
parent
e81c404b04
commit
b6f4862024
1 changed files with 7 additions and 13 deletions
|
@ -4348,12 +4348,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp)
|
|||
ACTION_PARAM_INT(flags, 5);
|
||||
ACTION_PARAM_STATE(success_state, 6);
|
||||
|
||||
fixed_t
|
||||
|
||||
oldx,
|
||||
oldy,
|
||||
oldz;
|
||||
|
||||
AActor *reference = COPY_AAPTR(self, destination_selector);
|
||||
|
||||
if (!reference)
|
||||
|
@ -4362,6 +4356,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp)
|
|||
return;
|
||||
}
|
||||
|
||||
fixed_t oldx = self->x;
|
||||
fixed_t oldy = self->y;
|
||||
fixed_t oldz = self->z;
|
||||
|
||||
if (!(flags & WARPF_ABSOLUTEANGLE))
|
||||
{
|
||||
angle += (flags & WARPF_USECALLERANGLE) ? self->angle : reference->angle;
|
||||
|
@ -4371,20 +4369,16 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp)
|
|||
if (!(flags & WARPF_ABSOLUTEOFFSET))
|
||||
{
|
||||
angle_t fineangle = angle >> ANGLETOFINESHIFT;
|
||||
oldx = xofs;
|
||||
fixed_t xofs1 = xofs;
|
||||
|
||||
// (borrowed from A_SpawnItemEx, assumed workable)
|
||||
// in relative mode negative y values mean 'left' and positive ones mean 'right'
|
||||
// This is the inverse orientation of the absolute mode!
|
||||
|
||||
xofs = FixedMul(oldx, finecosine[fineangle]) + FixedMul(yofs, finesine[fineangle]);
|
||||
yofs = FixedMul(oldx, finesine[fineangle]) - FixedMul(yofs, finecosine[fineangle]);
|
||||
xofs = FixedMul(xofs1, finecosine[fineangle]) + FixedMul(yofs, finesine[fineangle]);
|
||||
yofs = FixedMul(xofs1, finesine[fineangle]) - FixedMul(yofs, finecosine[fineangle]);
|
||||
}
|
||||
|
||||
oldx = self->x;
|
||||
oldy = self->y;
|
||||
oldz = self->z;
|
||||
|
||||
if (flags & WARPF_TOFLOOR)
|
||||
{
|
||||
// set correct xy
|
||||
|
|
Loading…
Reference in a new issue