mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-05-31 09:21:36 +00:00
- address bad use of pitch in A_CustomMissile.
This function calculated everything correctly but ultimately set the vertical velocity wrong. Most importantly this meant that the actual velocity vector and actor pitch - if CMF_SAVEPITCH was used - did not match. Since this bug has been present since the pitch parameter was added, this deprecates A_CustomMissile and replaces it with a properly implemented A_SpawnProjectile function and handling the compatibility case with a new flag and a scripted wrapper function. All internal uses of A_CustomMissile have been replaced as well.
This commit is contained in:
parent
4fcf9933f0
commit
d4c0ee9e43
15 changed files with 32 additions and 19 deletions
|
@ -1454,10 +1454,11 @@ enum CM_Flags
|
|||
CMF_OFFSETPITCH = 32,
|
||||
CMF_SAVEPITCH = 64,
|
||||
|
||||
CMF_ABSOLUTEANGLE = 128
|
||||
CMF_ABSOLUTEANGLE = 128,
|
||||
CMF_BADPITCH = 256
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_CustomMissile)
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_SpawnProjectile)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_CLASS (ti, AActor);
|
||||
|
@ -1525,6 +1526,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CustomMissile)
|
|||
}
|
||||
missilespeed = fabs(Pitch.Cos() * missile->Speed);
|
||||
missile->Vel.Z = Pitch.Sin() * missile->Speed;
|
||||
if (!(flags & CMF_BADPITCH)) missile->Vel.Z *= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue