- remap all easy HitScan calls with zero range to the new base function.

This commit is contained in:
Christoph Oelckers 2022-09-27 16:36:31 +02:00
parent 6b579156aa
commit 2af18ec277
7 changed files with 22 additions and 24 deletions

View file

@ -90,7 +90,7 @@ void StompSeqCallback(int, DBloodActor* actor)
const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode(); // use new sector checking logic
auto sectorMap = GetClosestSpriteSectors(pSector, actor->spr.pos.XY(), nDist, nullptr, newSectCheckMethod);
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector() * 1024, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector() * 1024, 0), CLIPMASK1, 0);
DBloodActor* actorh = nullptr;
actHitcodeToData(hit, &gHitInfo, &actorh);
@ -243,7 +243,7 @@ static void beastThinkChase(DBloodActor* actor)
if (nDist < 0x140 && nDist > 0xa0 && nDeltaAngle < DAngle15 && (target->spr.flags & 2)
&& target->IsPlayerActor() && Chance(0x8000))
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
if (target->xspr.health > (unsigned)gPlayerTemplate[0].startHealth / 2)
{
switch (hit)
@ -275,7 +275,7 @@ static void beastThinkChase(DBloodActor* actor)
}
if (nDist < 57.5625 && abs(nDeltaAngle) < mapangle(28))
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:

View file

@ -162,9 +162,7 @@ static void calebThinkChase(DBloodActor* actor)
actor->dudeSlope = nDist == 0 ? 0 : target->spr.pos.Z - actor->spr.pos.Z / nDist * 16384;
if (nDist < 89.5625 && abs(nDeltaAngle) < DAngle1 * 5)
{
int dx = dvec.X * worldtoint;
int dy = dvec.Y * worldtoint;
int hit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:

View file

@ -389,7 +389,7 @@ static void cerberusThinkChase(DBloodActor* actor)
}
else if (nDist < 0x20 && nDeltaAngle < DAngle15)
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (actor->spr.type) {
case kDudeCerberusTwoHead:
switch (hit) {

View file

@ -284,7 +284,7 @@ static void cultThinkChase(DBloodActor* actor)
&& (target->spr.flags & 2) && gGameOptions.nDifficulty > 2 && target->IsPlayerActor() && gPlayer[target->spr.type - kDudePlayer1].isRunning
&& Chance(0x8000))
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -305,7 +305,7 @@ static void cultThinkChase(DBloodActor* actor)
}
else if (nDist < 0x460 && nDeltaAngle < DAngle1 * 5)
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -352,7 +352,7 @@ static void cultThinkChase(DBloodActor* actor)
&& (target->spr.flags & 2) && gGameOptions.nDifficulty >= 2 && target->IsPlayerActor() && !gPlayer[target->spr.type - kDudePlayer1].isRunning
&& Chance(0x8000))
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -373,7 +373,7 @@ static void cultThinkChase(DBloodActor* actor)
}
else if (nDist < 0x320 && nDeltaAngle < DAngle1 * 5)
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -420,7 +420,7 @@ static void cultThinkChase(DBloodActor* actor)
&& (target->spr.flags & 2) && gGameOptions.nDifficulty > 2 && target->IsPlayerActor() && gPlayer[target->spr.type - kDudePlayer1].isRunning
&& Chance(0x8000))
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -442,7 +442,7 @@ static void cultThinkChase(DBloodActor* actor)
else if (nDist < 0x320 && nDeltaAngle < DAngle1 * 5)
{
AISTATE *pCultistTsProneFire = !cl_bloodvanillaenemies && !VanillaMode() ? &cultistTsProneFireFixed : &cultistTsProneFire;
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -487,7 +487,7 @@ static void cultThinkChase(DBloodActor* actor)
case kDudeCultistTNT:
if (nDist < 0x2c0 && nDist > 0x140 && nDeltaAngle < DAngle15 && (target->spr.flags & 2) && target->IsPlayerActor())
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -507,7 +507,7 @@ static void cultThinkChase(DBloodActor* actor)
}
else if (nDist < 0x140 && nDeltaAngle < DAngle15 && (target->spr.flags & 2) && target->IsPlayerActor())
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -531,7 +531,7 @@ static void cultThinkChase(DBloodActor* actor)
&& (target->spr.flags & 2) && gGameOptions.nDifficulty > 2 && target->IsPlayerActor() && gPlayer[target->spr.type - kDudePlayer1].isRunning
&& Chance(0x8000))
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -552,7 +552,7 @@ static void cultThinkChase(DBloodActor* actor)
}
else if (nDist < 0x320 && abs(nDeltaAngle) < DAngle1 * 5)
{
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:

View file

@ -362,7 +362,7 @@ static void gargThinkChase(DBloodActor* actor)
case kDudeGargoyleFlesh:
if (nDist < 0x180 && nDist > 0xc0 && angWithinRange)
{
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dxy, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -387,7 +387,7 @@ static void gargThinkChase(DBloodActor* actor)
}
else if (nDist < 0x40 && angWithinRange)
{
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dxy, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -421,7 +421,7 @@ static void gargThinkChase(DBloodActor* actor)
case kDudeGargoyleStone:
if (nDist < 0x180 && nDist > 0xc0 && angWithinRange)
{
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dxy, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -446,7 +446,7 @@ static void gargThinkChase(DBloodActor* actor)
}
else if (nDist < 0x40 && angWithinRange)
{
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dxy, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:

View file

@ -338,7 +338,7 @@ static void ghostThinkChase(DBloodActor* actor)
switch (actor->spr.type) {
case kDudePhantasm:
if (nDist < 0x200 && nDist > 0x100 && angWithinRange) {
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dxy, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:
@ -358,7 +358,7 @@ static void ghostThinkChase(DBloodActor* actor)
}
else if (nDist < 0x40 && angWithinRange)
{
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dxy, 0), CLIPMASK1, 0);
switch (hit)
{
case -1:

View file

@ -4649,7 +4649,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
var = HitScan_(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, (!objActor->hasX()) ? 0 : objActor->dudeSlope * inttoworld), arg1, arg3 << 1);
else if ((objActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR)
{
var3 = (objActor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 8192 : -8192; // was 0x20000 - HitScan_ uses Q28.4 for dz!
var3 = (objActor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 8192 : -8192; // was 0x20000 - HitScan uses Q28.4 for dz!
var = HitScan_(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, var3), arg1, arg3 << 1);
}
else