mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
- floatified WeaponAutoAimZVel
This commit is contained in:
parent
1bf6170fc1
commit
933e5eb35a
1 changed files with 10 additions and 11 deletions
|
@ -12238,23 +12238,22 @@ int WeaponAutoAimZvel(DSWActor* actor, DSWActor* missileActor, int *zvel, short
|
|||
|
||||
if (dist != 0)
|
||||
{
|
||||
int tos, diff, siz;
|
||||
|
||||
tos = int_ActorZOfTop(hitActor);
|
||||
diff = missileActor->int_pos().Z - tos;
|
||||
siz = int_ActorSizeZ(hitActor);
|
||||
double zh;
|
||||
double tos = ActorZOfTop(hitActor);
|
||||
double diff = missileActor->spr.pos.Z - tos;
|
||||
double siz = ActorSizeZ(hitActor);
|
||||
|
||||
// hit_sprite is below
|
||||
if (diff < -Z(50))
|
||||
zh = tos + (siz >> 1);
|
||||
if (diff < -50)
|
||||
zh = tos + (siz * 0.5);
|
||||
else
|
||||
// hit_sprite is above
|
||||
if (diff > Z(50))
|
||||
zh = tos + (siz >> 3);
|
||||
if (diff > 50)
|
||||
zh = tos + (siz * 0.125);
|
||||
else
|
||||
zh = tos + (siz >> 2);
|
||||
zh = tos + (siz * 0.25);
|
||||
|
||||
*zvel = (missileActor->spr.xvel * (zh - missileActor->int_pos().Z)) / dist;
|
||||
*zvel = int((missileActor->spr.xvel * (zh - missileActor->spr.pos.Z)) / dist * (zworldtoint));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue