- Duke: Replace player_struct noise_* variables with a vector.

This commit is contained in:
Mitchell Richters 2021-12-30 23:04:58 +11:00
parent 1e90b0bbbe
commit 225a2a39da
6 changed files with 15 additions and 14 deletions

View file

@ -35,8 +35,8 @@ int madenoise(int snum)
player_struct *p;
p = &ps[snum];
p->donoise = 1;
p->noise_x = p->pos.X;
p->noise_y = p->pos.Y;
p->noise.X = p->pos.X;
p->noise.Y = p->pos.Y;
return 1;
}
@ -52,8 +52,8 @@ int wakeup(DDukeActor* actor, int snum)
radius = p->noise_radius;
if (p->noise_x - radius < actor->spr.pos.X && p->noise_x + radius > actor->spr.pos.X
&& p->noise_y - radius < actor->spr.pos.Y && p->noise_y + radius > actor->spr.pos.Y)
if (p->noise.X - radius < actor->spr.pos.X && p->noise.X + radius > actor->spr.pos.X
&& p->noise.Y - radius < actor->spr.pos.Y && p->noise.Y + radius > actor->spr.pos.Y)
return 1;
return 0;
}

View file

@ -1176,8 +1176,8 @@ DEFINE_FIELD_X(DukePlayer, player_struct, actors_killed)
DEFINE_FIELD_X(DukePlayer, player_struct, resurrected)
DEFINE_FIELD_X(DukePlayer, player_struct, stairs)
DEFINE_FIELD_X(DukePlayer, player_struct, detonate_count)
DEFINE_FIELD_X(DukePlayer, player_struct, noise_x)
DEFINE_FIELD_X(DukePlayer, player_struct, noise_y)
//DEFINE_FIELD_X(DukePlayer, player_struct, noise.X)
//DEFINE_FIELD_X(DukePlayer, player_struct, noise.Y)
DEFINE_FIELD_X(DukePlayer, player_struct, noise_radius)
DEFINE_FIELD_X(DukePlayer, player_struct, drink_timer)
DEFINE_FIELD_X(DukePlayer, player_struct, eat_timer)

View file

@ -170,8 +170,8 @@ void resetplayerstats(int snum)
p->fist_incs = 0;
p->knee_incs = 0;
p->stairs = 0;
p->noise_x = 0;
p->noise_y = 0;
p->noise.X = 0;
p->noise.Y = 0;
p->donoise = 0;
p->noise_radius = 0;
if (isRR() && ud.multimode > 1 && ud.coop != 1)
@ -442,8 +442,8 @@ void resetprestat(int snum,int g)
p->stairs = 0;
//if (!isRRRA()) p->fogtype = 0;
p->noise_x = 131072;
p->noise_y = 131072;
p->noise.X = 131072;
p->noise.Y = 131072;
p->donoise = 0;
p->noise_radius = 0;

View file

@ -227,8 +227,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
// RR from here on
("stairs", w.stairs)
("detonate_count", w.detonate_count)
("noise_x", w.noise_x)
("noise_y", w.noise_y)
("noise.X", w.noise.X)
("noise.Y", w.noise.Y)
("noise_radius", w.noise_radius)
("drink_timer", w.drink_timer)
("eat_timer", w.eat_timer)

View file

@ -263,7 +263,8 @@ struct player_struct
// Items were reordered by size.
int stairs;
int detonate_count; // at57e
int noise_x, noise_y, noise_radius; // at286, at28a, at290
vec2_t noise;
int noise_radius; // at286, at28a, at290
int drink_timer; // at58e
int eat_timer; // at592
int SlotWin;

View file

@ -209,7 +209,7 @@ struct DukePlayer
// Items were reordered by size.
native int stairs;
native int detonate_count; // at57e
native int noise_x, noise_y, noise_radius; // at286, at28a, at290
native int noise_radius; // at286, at28a, at290
native int drink_timer; // at58e
native int eat_timer; // at592
native int SlotWin;