- some getangle and SpawnActor calls

This commit is contained in:
Christoph Oelckers 2022-08-22 18:42:25 +02:00
parent a0c0894e41
commit 3a0eec76ad
4 changed files with 11 additions and 9 deletions

View file

@ -1392,7 +1392,7 @@ int FindNewAngle(DSWActor* actor, int dir, int DistToMove)
DistToMove = (DistToMove >> 2) + (DistToMove >> 3);
// Find angle to from the player
oang = NORM_ANGLE(getangle(actor->user.targetActor->int_pos().X - actor->int_pos().X, actor->user.targetActor->int_pos().Y - actor->int_pos().Y));
oang = NORM_ANGLE(getangle(actor->user.targetActor->spr.pos - actor->spr.pos));
// choose a random angle array
switch (dir)

View file

@ -51,6 +51,10 @@ void SortBreakInfo(void);
BREAK_INFO* SetupWallForBreak(walltype* wallp);
BREAK_INFO* SetupSpriteForBreak(DSWActor* actor);
bool HitBreakWall(walltype* wp, int, int, int, int ang, int type);
inline bool HitBreakWall(walltype* wp, const DVector3& pos, DAngle angle, int type)
{
return HitBreakWall(wp, pos.X * worldtoint, pos.Y * worldtoint, pos.Z * zworldtoint, angle.Buildang(), type);
}
bool CheckBreakToughness(BREAK_INFO* break_info, int ID);
int WallBreakPosition(walltype* wp, sectortype** sectp, int* x, int* y, int* z, int* ang);
void SortBreakInfo(void);

View file

@ -2077,12 +2077,12 @@ inline bool SectorIsUnderwaterArea(sectortype* sect)
inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, int range)
{
return (abs(getincangle(getangle(a->int_pos().X - (pp)->int_ppos().X, a->int_pos().Y - (pp)->int_ppos().Y), (pp)->angle.ang.Buildang())) < (range));
return (abs(getincangle(getangle(a->spr.pos - pp->pos), (pp)->angle.ang.Buildang())) < (range));
}
inline bool FacingRange(DSWActor* a1, DSWActor* a2, int range)
{
return (abs(getincangle(getangle(a1->int_pos().X - a2->int_pos().X, a1->int_pos().Y - a2->int_pos().Y), a2->int_ang())) < (range));
return (abs(getincangle(getangle(a1->spr.pos - a2->spr.pos), a2->int_ang())) < (range));
}
inline void SET_BOOL1(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL1; }
inline void SET_BOOL2(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL2; }
@ -2241,7 +2241,7 @@ inline int ActorSizeY(DSWActor* sp)
inline bool Facing(DSWActor* actor1, DSWActor* actor2)
{
return (abs(getincangle(getangle(actor1->int_pos().X - actor2->int_pos().X, actor1->int_pos().Y - actor2->int_pos().Y), actor2->int_ang())) < 512);
return (abs(getincangle(getangle(actor1->spr.pos - actor2->spr.pos), actor2->int_ang())) < 512);
}
// Given a z height and sprite return the correct y repeat value

View file

@ -293,7 +293,7 @@ int DoWallBloodDrip(DSWActor* actor)
void SpawnMidSplash(DSWActor* actor)
{
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, int_ActorZOfMiddle(actor), actor->int_ang(), 0);
DVector3(actor->spr.pos.XY(), ActorZOfMiddle(actor)), actor->spr.angle, 0);
actorNew->spr.shade = -12;
actorNew->spr.xrepeat = 70-RandomRange(20);
@ -315,8 +315,7 @@ void SpawnMidSplash(DSWActor* actor)
void SpawnFloorSplash(DSWActor* actor)
{
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreFloorSplash, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->int_ang(), 0);
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreFloorSplash, actor->sector(), actor->spr.pos, actor->spr.angle, 0);
actorNew->spr.shade = -12;
actorNew->spr.xrepeat = 70-RandomRange(20);
@ -515,8 +514,7 @@ int DoBloodSpray(DSWActor* actor)
if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER)))
{
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_BloodSpray, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->int_ang(), 100);
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_BloodSpray, actor->sector(), actor->spr.pos, actor->spr.angle, 100);
SetOwner(actor, actorNew);
actorNew->spr.shade = -12;