- Blood: Replace XSPRITE targetz with TargetPos.Z calls.

This commit is contained in:
Mitchell Richters 2021-12-30 21:24:43 +11:00
parent 431749cf6e
commit f091a72db1
8 changed files with 15 additions and 16 deletions

View file

@ -3970,7 +3970,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
{
missileActor->spr.picnum = 2123;
missileActor->SetTarget(actorHit);
missileActor->xspr.targetZ = missileActor->spr.pos.Z - actorHit->spr.pos.Z;
missileActor->xspr.TargetPos.Z = missileActor->spr.pos.Z - actorHit->spr.pos.Z;
missileActor->xspr.goalAng = getangle(missileActor->spr.pos.X - actorHit->spr.pos.X, missileActor->spr.pos.Y - actorHit->spr.pos.Y) - actorHit->spr.ang;
missileActor->xspr.state = 1;
actPostSprite(missileActor, kStatFlare);
@ -6149,7 +6149,7 @@ void actCheckFlares()
{
int x = target->spr.pos.X + mulscale30r(Cos(actor->xspr.goalAng + target->spr.ang), target->spr.clipdist * 2);
int y = target->spr.pos.Y + mulscale30r(Sin(actor->xspr.goalAng + target->spr.ang), target->spr.clipdist * 2);
int z = target->spr.pos.Z + actor->xspr.targetZ;
int z = target->spr.pos.Z + actor->xspr.TargetPos.Z;
vec3_t pos = { x, y, z };
SetActor(actor, &pos);
actor->vel.X = target->vel.X;

View file

@ -918,7 +918,7 @@ void aiSetTarget(DBloodActor* actor, int x, int y, int z)
actor->SetTarget(nullptr);
actor->xspr.TargetPos.X = x;
actor->xspr.TargetPos.Y = y;
actor->xspr.targetZ = z;
actor->xspr.TargetPos.Z = z;
}
void aiSetTarget(DBloodActor* actor, DBloodActor* target)
@ -936,7 +936,7 @@ void aiSetTarget(DBloodActor* actor, DBloodActor* target)
DUDEINFO* pDudeInfo = getDudeInfo(target->spr.type);
actor->xspr.TargetPos.X = target->spr.pos.X;
actor->xspr.TargetPos.Y = target->spr.pos.Y;
actor->xspr.targetZ = target->spr.pos.Z - ((pDudeInfo->eyeHeight * target->spr.yrepeat) << 2);
actor->xspr.TargetPos.Z = target->spr.pos.Z - ((pDudeInfo->eyeHeight * target->spr.yrepeat) << 2);
}
}
}
@ -1708,7 +1708,7 @@ void aiInitSprite(DBloodActor* actor)
pTargetMarker = actor->GetTarget();
targetX = actor->xspr.TargetPos.X;
targetY = actor->xspr.TargetPos.Y;
targetZ = actor->xspr.targetZ;
targetZ = actor->xspr.TargetPos.Z;
}
}
#endif
@ -1928,7 +1928,7 @@ void aiInitSprite(DBloodActor* actor)
actor->SetTarget(pTargetMarker);
actor->xspr.TargetPos.X = targetX;
actor->xspr.TargetPos.Y = targetY;
actor->xspr.targetZ = targetZ;
actor->xspr.TargetPos.Z = targetZ;
}
// reset target spot progress

View file

@ -403,7 +403,7 @@ void batMoveToCeil(DBloodActor* actor)
int x = actor->spr.pos.X;
int y = actor->spr.pos.Y;
int z = actor->spr.pos.Z;
if (z - actor->xspr.targetZ < 0x1000)
if (z - actor->xspr.TargetPos.Z < 0x1000)
{
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
pDudeExtraE->thinkTime = 0;

View file

@ -407,7 +407,7 @@ void eelMoveToCeil(DBloodActor* actor)
int x = actor->spr.pos.X;
int y = actor->spr.pos.Y;
int z = actor->spr.pos.Z;
if (z - actor->xspr.targetZ < 0x1000)
if (z - actor->xspr.TargetPos.Z < 0x1000)
{
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
pDudeExtraE->active = 0;

View file

@ -575,7 +575,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, sect
/*pXSprite->target_i = */ bitReader.readSigned(16);
pXSprite->TargetPos.X = bitReader.readSigned(32);
pXSprite->TargetPos.Y = bitReader.readSigned(32);
pXSprite->targetZ = bitReader.readSigned(32);
pXSprite->TargetPos.Z = bitReader.readSigned(32);
pXSprite->burnTime = bitReader.readUnsigned(16);
/*pXSprite->burnSource =*/ bitReader.readSigned(16);
pXSprite->height = bitReader.readUnsigned(16);

View file

@ -625,7 +625,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSPRITE& w, XSPRIT
("data4", w.data4, def->data4)
("targetX", w.TargetPos.X, def->TargetPos.X)
("targetY", w.TargetPos.Y, def->TargetPos.Y)
("targetZ", w.targetZ, def->targetZ)
("targetZ", w.TargetPos.Z, def->TargetPos.Z)
("target", w.target, def->target)
("sysdata1", w.sysData1, def->sysData1)
("sysdata2", w.sysData2, def->sysData2)

View file

@ -101,7 +101,6 @@ struct XSPRITE {
TObjPtr<DBloodActor*> target; // target sprite
TObjPtr<DBloodActor*> burnSource;
int32_t targetZ; // target z
vec3_t TargetPos;
int32_t sysData1; // used to keep here various system data, so user can't change it in map editor
int32_t sysData2; //

View file

@ -689,7 +689,7 @@ void nnExtInitModernStuff(TArray<DBloodActor*>& actors)
actor->xspr.Proximity = actor->xspr.Push = actor->xspr.Vector = actor->xspr.triggerOn = false;
actor->xspr.state = actor->xspr.restState = 0;
actor->xspr.TargetPos.X = actor->xspr.TargetPos.Y = actor->xspr.targetZ = actor->xspr.sysData2 = -1;
actor->xspr.TargetPos.X = actor->xspr.TargetPos.Y = actor->xspr.TargetPos.Z = actor->xspr.sysData2 = -1;
actor->SetTarget(nullptr);
ChangeActorStat(actor, kStatModernCondition);
auto oldStat = actor->spr.cstat;
@ -3010,7 +3010,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
{
int x = actor->xspr.TargetPos.X;
int y = actor->xspr.TargetPos.Y;
int z = actor->xspr.targetZ;
int z = actor->xspr.TargetPos.Z;
auto target = actor->GetTarget();
aiInitSprite(actor);
@ -3019,7 +3019,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
{
actor->xspr.TargetPos.X = x;
actor->xspr.TargetPos.Y = y;
actor->xspr.targetZ = z;
actor->xspr.TargetPos.Z = z;
actor->SetTarget(target);
aiActivateDude(actor);
}
@ -6826,7 +6826,7 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor)
auto pMate = pMateTargetActor->GetTarget();
actor->xspr.TargetPos.X = pMate->spr.pos.X;
actor->xspr.TargetPos.Y = pMate->spr.pos.Y;
actor->xspr.targetZ = pMate->spr.pos.Z;
actor->xspr.TargetPos.Z = pMate->spr.pos.Z;
if (!isActive(actor))
aiActivateDude(actor);
return;
@ -7720,7 +7720,7 @@ void aiPatrolStop(DBloodActor* actor, DBloodActor* targetactor, bool alarm)
else
{
aiInitSprite(actor);
aiSetTarget(actor, actor->xspr.TargetPos.X, actor->xspr.TargetPos.Y, actor->xspr.targetZ);
aiSetTarget(actor, actor->xspr.TargetPos.X, actor->xspr.TargetPos.Y, actor->xspr.TargetPos.Z);
}
actor->xspr.dudeFlag4 = patrol; // this must be kept so enemy can patrol after respawn again