Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- deal with a few ->sectnum's in SW.
  • Loading branch information
coelckers committed Dec 4, 2021
1 parent 86bd606 commit 78bbc31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion source/games/sw/src/skel.cpp
Expand Up @@ -570,7 +570,7 @@ int DoSkelTeleport(DSWActor* actor)

SetActorZ(actor, &sp->pos);

if (sp->sectnum != -1)
if (sp->insector())
break;
}

Expand Down
3 changes: 1 addition & 2 deletions source/games/sw/src/sprite.cpp
Expand Up @@ -4767,7 +4767,6 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
DSWActor* highActor;
DSWActor* lowActor;
SECTORp lo_sectp, hi_sectp;
short sectnum;
short dist;
int cliptype = CLIPMASK_ACTOR;

Expand All @@ -4789,7 +4788,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
highActor = u->highActor;
lo_sectp = u->lo_sectp;
hi_sectp = u->hi_sectp;
sectnum = sp->sectnum;
auto sect = sp->sector();

u->coll = move_sprite(actor, xchange, ychange, zchange,
u->ceiling_dist, u->floor_dist, cliptype, ACTORMOVETICS);
Expand Down
11 changes: 5 additions & 6 deletions source/games/sw/src/weapon.cpp
Expand Up @@ -10264,7 +10264,7 @@ void SpawnBreakStaticFlames(DSWActor* actor)

nu->Radius = 200;
nu->floor_dist = nu->ceiling_dist = 0;
np->z = getflorzofslope(np->sectnum,np->x,np->y);
np->z = getflorzofslopeptr(np->sector(), np->x, np->y);

PlaySound(DIGI_FIRE1,actorNew,v3df_dontpan|v3df_doppler);
}
Expand Down Expand Up @@ -10892,7 +10892,7 @@ void SpawnExpZadjust(DSWActor* actor, DSWActor* expActor, int upper_zsize, int l
{
int cz,fz;

getzsofslope(exp->sectnum, exp->x, exp->y, &cz, &fz);
getzsofslopeptr(exp->sector(), exp->x, exp->y, &cz, &fz);

tos_z = exp->z - upper_zsize;
bos_z = exp->z + lower_zsize;
Expand Down Expand Up @@ -11397,7 +11397,6 @@ int DoBloodWorm(DSWActor* actor)
int xvect,yvect;
int bx,by;
int amt;
int sectnum;

u->coll = move_ground_missile(actor, u->xchange, u->ychange, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);

Expand Down Expand Up @@ -11460,9 +11459,9 @@ int DoBloodWorm(DSWActor* actor)
sp->x += MulScale(amt,xvect, 15);
sp->y += MulScale(amt,yvect, 15);

sectnum = sp->sectnum;
updatesectorz(sp->x, sp->y, sp->z, &sectnum);
if (sectnum >= 0)
auto sect = sp->sector();
updatesectorz(sp->x, sp->y, sp->z, &sect);
if (sect)
{
GlobalSkipZrange = true;
InitBloodSpray(actor, false, 1);
Expand Down

0 comments on commit 78bbc31

Please sign in to comment.