mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 12:31:32 +00:00
Merge branch 'shocksplit' into 'next'
Split up x/y/z averages in A_Boss3ShockThink (resolves #589) Closes #589 See merge request STJr/SRB2!1538
This commit is contained in:
commit
9187656b90
1 changed files with 5 additions and 3 deletions
|
@ -8272,7 +8272,7 @@ void A_Boss3ShockThink(mobj_t *actor)
|
||||||
fixed_t x0, y0, x1, y1;
|
fixed_t x0, y0, x1, y1;
|
||||||
|
|
||||||
// Break the link if movements are too different
|
// Break the link if movements are too different
|
||||||
if (FixedHypot(snext->momx - actor->momx, snext->momy - actor->momy) > 12*actor->scale)
|
if (R_PointToDist2(0, 0, snext->momx - actor->momx, snext->momy - actor->momy) > 12*actor->scale)
|
||||||
{
|
{
|
||||||
P_SetTarget(&actor->hnext, NULL);
|
P_SetTarget(&actor->hnext, NULL);
|
||||||
return;
|
return;
|
||||||
|
@ -8283,9 +8283,11 @@ void A_Boss3ShockThink(mobj_t *actor)
|
||||||
y0 = actor->y;
|
y0 = actor->y;
|
||||||
x1 = snext->x;
|
x1 = snext->x;
|
||||||
y1 = snext->y;
|
y1 = snext->y;
|
||||||
if (FixedHypot(x1 - x0, y1 - y0) > 2*actor->radius)
|
if (R_PointToDist2(0, 0, x1 - x0, y1 - y0) > 2*actor->radius)
|
||||||
{
|
{
|
||||||
snew = P_SpawnMobj((x0 + x1) >> 1, (y0 + y1) >> 1, (actor->z + snext->z) >> 1, actor->type);
|
snew = P_SpawnMobj((x0 >> 1) + (x1 >> 1),
|
||||||
|
(y0 >> 1) + (y1 >> 1),
|
||||||
|
(actor->z >> 1) + (snext->z >> 1), actor->type);
|
||||||
snew->momx = (actor->momx + snext->momx) >> 1;
|
snew->momx = (actor->momx + snext->momx) >> 1;
|
||||||
snew->momy = (actor->momy + snext->momy) >> 1;
|
snew->momy = (actor->momy + snext->momy) >> 1;
|
||||||
snew->momz = (actor->momz + snext->momz) >> 1; // is this really needed?
|
snew->momz = (actor->momz + snext->momz) >> 1; // is this really needed?
|
||||||
|
|
Loading…
Reference in a new issue