mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- floatified sectortype::ang
This commit is contained in:
parent
ce7533c1c4
commit
2838fa3e72
6 changed files with 13 additions and 13 deletions
|
@ -329,7 +329,7 @@ struct sectortype
|
|||
int flags;
|
||||
int depth_fixed;
|
||||
short stag; // ST? tag number - for certain things it helps to know it
|
||||
short ang;
|
||||
DAngle angle;
|
||||
short height;
|
||||
short speed;
|
||||
short damage;
|
||||
|
|
|
@ -590,7 +590,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, sectortype &c, sectort
|
|||
arc("flags", c.flags, def->flags)
|
||||
("depth_fixed", c.depth_fixed, def->depth_fixed)
|
||||
("stag", c.stag, def->stag)
|
||||
("ang", c.ang, def->ang)
|
||||
("ang", c.angle, def->angle)
|
||||
("height", c.height, def->height)
|
||||
("speed", c.speed, def->speed)
|
||||
("damage", c.damage, def->damage)
|
||||
|
|
|
@ -287,21 +287,20 @@ void DoDebrisCurrent(DSWActor* actor)
|
|||
auto sectp = actor->sector();
|
||||
|
||||
//actor->spr.clipdist = (256+128)>>2;
|
||||
double spd = sectp->speed / 64.0;
|
||||
|
||||
nx = MulScale((sectp->speed >> 2), bcos(sectp->ang), 14);
|
||||
ny = MulScale((sectp->speed >> 2), bsin(sectp->ang), 14);
|
||||
auto vect = sectp->angle.ToVector() * spd;
|
||||
|
||||
Collision ret = move_sprite(actor, nx, ny, 0, actor->user.int_ceiling_dist(), actor->user.int_floor_dist(), 0, ACTORMOVETICS);
|
||||
Collision ret = move_sprite(actor, DVector3(vect, 0), actor->user.ceiling_dist, actor->user.floor_dist, 0, ACTORMOVETICS);
|
||||
|
||||
// attempt to move away from wall
|
||||
if (ret.type != kHitNone)
|
||||
{
|
||||
int rang = RANDOM_P2(2048);
|
||||
DAngle rang = RANDOM_ANGLE();
|
||||
|
||||
nx = MulScale((sectp->speed >> 2), bcos(sectp->ang + rang), 14);
|
||||
nx = MulScale((sectp->speed >> 2), bsin(sectp->ang + rang), 14);
|
||||
vect = (sectp->angle + rang).ToVector() * spd;
|
||||
|
||||
move_sprite(actor, nx, ny, 0, actor->user.int_ceiling_dist(), actor->user.int_floor_dist(), 0, ACTORMOVETICS);
|
||||
move_sprite(actor, DVector3(vect, 0), actor->user.ceiling_dist, actor->user.floor_dist, 0, ACTORMOVETICS);
|
||||
}
|
||||
|
||||
actor->spr.pos.Z = actor->user.loz;
|
||||
|
|
|
@ -197,7 +197,7 @@ void CopySectorMatch(int match)
|
|||
dsectp->flags = ssectp->flags;
|
||||
dsectp->depth_fixed = ssectp->depth_fixed;
|
||||
dsectp->stag = ssectp->stag;
|
||||
dsectp->ang = ssectp->ang;
|
||||
dsectp->angle = ssectp->angle;
|
||||
dsectp->height = ssectp->height;
|
||||
dsectp->speed = ssectp->speed;
|
||||
dsectp->damage = ssectp->damage;
|
||||
|
|
|
@ -4492,8 +4492,9 @@ void DoPlayerCurrent(PLAYER* pp)
|
|||
if (!sectu)
|
||||
return;
|
||||
|
||||
xvect = sectu->speed * synctics * bcos(sectu->ang) >> 4;
|
||||
yvect = sectu->speed * synctics * bsin(sectu->ang) >> 4;
|
||||
auto vect = sectu->angle.ToVector() * 1024; // 16384 >> 4 - Beware of clipmove's odd format for vect!
|
||||
xvect = sectu->speed * synctics * vect.X;
|
||||
yvect = sectu->speed * synctics * vect.Y;
|
||||
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)pp->actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
|
|
|
@ -1736,7 +1736,7 @@ void SpriteSetup(void)
|
|||
{
|
||||
sectp->u_defined = true;
|
||||
sectp->speed = actor->spr.lotag;
|
||||
sectp->ang = actor->int_ang();
|
||||
sectp->angle = actor->spr.angle;
|
||||
KillActor(actor);
|
||||
}
|
||||
else if (bit & (SECTFX_NO_RIDE))
|
||||
|
|
Loading…
Reference in a new issue