- fishy grenade stuff

This commit is contained in:
Christoph Oelckers 2022-08-20 17:53:53 +02:00
parent 163146250d
commit c0c74fca84
2 changed files with 10 additions and 9 deletions

View file

@ -98,13 +98,13 @@ void AIFishLimb::Tick(RunListEvent* ev)
}
}
int FloorZ = pActor->sector()->int_floorz();
double FloorZ = pActor->sector()->floorz;
if (FloorZ <= pActor->int_pos().Z)
if (FloorZ <= pActor->spr.pos.Z)
{
pActor->spr.pos.Z++;
if ((pActor->int_pos().Z - FloorZ) > 25600)
if ((pActor->spr.pos.Z - FloorZ) > 100)
{
pActor->spr.zvel = 0;
runlist_DoSubRunRec(pActor->spr.intowner);
@ -112,7 +112,7 @@ void AIFishLimb::Tick(RunListEvent* ev)
runlist_SubRunRec(pActor->spr.hitag);
DeleteActor(pActor);
}
else if ((pActor->int_pos().Z - FloorZ) > 0)
else if ((pActor->spr.pos.Z - FloorZ) > 0)
{
pActor->spr.zvel = 1024;
}
@ -382,7 +382,7 @@ void AIFish::Tick(RunListEvent* ev)
pActor->spr.yvel = 0;
}
pActor->spr.zvel = (pTargetActor->int_pos().Z - pActor->int_pos().Z) >> 3;
pActor->spr.zvel = int((pTargetActor->spr.pos.Z - pActor->spr.pos.Z) * zworldtoint / 8);
}
break;
}

View file

@ -152,7 +152,7 @@ void ExplodeGrenade(DExhumedActor* pActor)
}
else
{
if (pActor->int_pos().Z < pGrenadeSect->int_floorz())
if (pActor->spr.pos.Z < pGrenadeSect->floorz)
{
var_20 = 200;
var_28 = 36;
@ -171,9 +171,10 @@ void ExplodeGrenade(DExhumedActor* pActor)
if (pActor->nTurn < 0)
{
auto pPlayerActor = PlayerList[nPlayer].pActor;
int nAngle = pPlayerActor->int_ang();
pActor->set_int_pos({ bcos(nAngle, -5) + pPlayerActor->int_pos().X, bsin(nAngle, -5) + pPlayerActor->int_pos().Y, pPlayerActor->int_pos().Z });
auto nAngle = pPlayerActor->spr.angle;
DVector2 vect = nAngle.ToVector() * 32;
pActor->spr.pos = pPlayerActor->spr.pos + vect;
ChangeActorSect(pActor, pPlayerActor->sector());