- handle several int_angle calls.

This commit is contained in:
Christoph Oelckers 2022-09-14 22:57:42 +02:00
parent e42036d43b
commit 2ea426be38
5 changed files with 16 additions and 18 deletions

View file

@ -1416,8 +1416,8 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3 &oldpo
(!isWorldTour() || proj->spr.picnum != FIREBALL) &&
(wal->overpicnum == MIRROR || wal->picnum == MIRROR))
{
int k = getangle(wal->delta());
proj->set_int_ang(((k << 1) - proj->int_ang()) & 2047);
DAngle k = VecToAngle(wal->delta());
proj->spr.angle = k * 2 - proj->spr.angle;
proj->SetOwner(proj);
spawn(proj, TRANSPORTERSTAR);
return true;
@ -1435,8 +1435,8 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3 &oldpo
proj->spr.yint--;
}
int k = getangle(wal->delta());
proj->set_int_ang(((k << 1) - proj->int_ang()) & 2047);
DAngle k = VecToAngle(wal->delta());
proj->spr.angle = k * 2 - proj->spr.angle;
return true;
}
}
@ -2639,9 +2639,8 @@ static void heavyhbomb(DDukeActor *actor)
auto wal = coll.hitWall;
fi.checkhitwall(actor, wal, actor->spr.pos, actor->spr.picnum);
int k = getangle(wal->delta());
actor->set_int_ang(((k << 1) - actor->int_ang()) & 2047);
DAngle k = VecToAngle(wal->delta());
actor->spr.angle = k * 2 - actor->spr.angle;
actor->vel.X *= 0.5;
}

View file

@ -1090,7 +1090,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
j->spr.xrepeat = 8;
j->spr.yrepeat = 8;
j->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
j->set_int_ang((j->int_ang() + 512) & 2047);
j->spr.angle += DAngle90;
j->set_native_clipdist(MulScale(proj->spr.xrepeat, tileWidth(proj->spr.picnum), 7));
}
}
@ -1103,8 +1103,8 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
proj->spr.yint--;
}
int k = getangle(wal->delta());
proj->set_int_ang(((k << 1) - proj->int_ang()) & 2047);
DAngle k = VecToAngle(wal->delta());
proj->spr.angle = k * 2 - proj->spr.angle;
return true;
}
}
@ -2410,8 +2410,6 @@ static void heavyhbomb(DDukeActor *actor)
auto wal = coll.hitWall;
fi.checkhitwall(actor, wal, actor->spr.pos, actor->spr.picnum);
int k = getangle(wal->delta());
if (actor->spr.picnum == CHEERBOMB)
{
actor->temp_data[3] = 1;
@ -2420,7 +2418,8 @@ static void heavyhbomb(DDukeActor *actor)
actor->vel.X = 0;
goto DETONATEB;
}
actor->set_int_ang(((k << 1) - actor->int_ang()) & 2047);
DAngle k = VecToAngle(wal->delta());
actor->spr.angle = k * 2 - actor->spr.angle;
actor->vel.X *= 0.5;
}
@ -2547,8 +2546,8 @@ static int henstand(DDukeActor *actor)
{
if (coll.type == kHitWall)
{
int k = getangle(coll.hitWall->delta());
actor->set_int_ang(((k << 1) - actor->int_ang()) & 2047);
DAngle k = VecToAngle(coll.hitWall->delta());
actor->spr.angle = k * 2 - actor->spr.angle;
}
else if (coll.type == kHitSprite)
{

View file

@ -125,7 +125,7 @@ void DoSpawn(player_struct *p, int snum)
else if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE3 ) )
{
// like chaingun shells
j->set_int_ang((j->int_ang() + 1024) & 2047);
j->spr.angle += DAngle90;
j->vel.X += 2.;
j->spr.pos.Z += 3;
ssp(j,CLIPMASK0);

View file

@ -71,7 +71,7 @@ void premapcontroller(DDukeActor* ac)
cyclers[numcyclers].shade1 = ac->spr.shade;
cyclers[numcyclers].shade2 = ac->sector()->floorshade;
cyclers[numcyclers].hitag = ac->spr.hitag;
cyclers[numcyclers].state = (ac->int_ang() == 1536);
cyclers[numcyclers].state = (ac->spr.angle == DAngle270);
numcyclers++;
deletesprite(ac);
break;

View file

@ -862,7 +862,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
break;
case SE_11_SWINGING_DOOR://Pivitor rotater
if (actor->int_ang() > 1024) actor->temp_data[3] = 2;
if (actor->spr.intangle > 1024) actor->temp_data[3] = 2;
else actor->temp_data[3] = -2;
[[fallthrough]];
case SE_0_ROTATING_SECTOR: