mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 19:21:44 +00:00
- Duke: pass a sector pointer to callsound.
This commit is contained in:
parent
f6db4a8e51
commit
64f1029416
7 changed files with 25 additions and 31 deletions
|
@ -2669,7 +2669,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE)
|
||||||
{
|
{
|
||||||
actor->tempang += 4;
|
actor->tempang += 4;
|
||||||
if (actor->tempang >= 256)
|
if (actor->tempang >= 256)
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
if (s->clipdist) l = 1;
|
if (s->clipdist) l = 1;
|
||||||
else l = -1;
|
else l = -1;
|
||||||
}
|
}
|
||||||
|
@ -2697,7 +2697,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE)
|
||||||
{
|
{
|
||||||
actor->tempang -= 4;
|
actor->tempang -= 4;
|
||||||
if (actor->tempang <= 0)
|
if (actor->tempang <= 0)
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
if (s->clipdist) l = -1;
|
if (s->clipdist) l = -1;
|
||||||
else l = 1;
|
else l = 1;
|
||||||
}
|
}
|
||||||
|
@ -3854,7 +3854,7 @@ void handle_se15(DDukeActor* actor)
|
||||||
if (t[3] >= (s->yvel >> 3))
|
if (t[3] >= (s->yvel >> 3))
|
||||||
{
|
{
|
||||||
t[4] = 0; //Turn off the sliders
|
t[4] = 0; //Turn off the sliders
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
t[3]++;
|
t[3]++;
|
||||||
|
@ -3864,7 +3864,7 @@ void handle_se15(DDukeActor* actor)
|
||||||
if (t[3] < 1)
|
if (t[3] < 1)
|
||||||
{
|
{
|
||||||
t[4] = 0;
|
t[4] = 0;
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
t[3]--;
|
t[3]--;
|
||||||
|
@ -4259,7 +4259,7 @@ void handle_se20(DDukeActor* actor)
|
||||||
s->x -= x;
|
s->x -= x;
|
||||||
s->y -= l;
|
s->y -= l;
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4612,7 +4612,7 @@ void handle_se32(DDukeActor *actor)
|
||||||
if (abs(sc->ceilingz - s->z) < (s->yvel << 1))
|
if (abs(sc->ceilingz - s->z) < (s->yvel << 1))
|
||||||
{
|
{
|
||||||
sc->ceilingz = s->z;
|
sc->ceilingz = s->z;
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
t[2] = 0;
|
t[2] = 0;
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
}
|
}
|
||||||
|
@ -4623,7 +4623,7 @@ void handle_se32(DDukeActor *actor)
|
||||||
if (abs(sc->ceilingz - t[1]) < (s->yvel << 1))
|
if (abs(sc->ceilingz - t[1]) < (s->yvel << 1))
|
||||||
{
|
{
|
||||||
sc->ceilingz = t[1];
|
sc->ceilingz = t[1];
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
t[2] = 0;
|
t[2] = 0;
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
}
|
}
|
||||||
|
@ -4638,7 +4638,7 @@ void handle_se32(DDukeActor *actor)
|
||||||
{
|
{
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
t[2] = !t[2];
|
t[2] = !t[2];
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
sc->ceilingz = s->z;
|
sc->ceilingz = s->z;
|
||||||
}
|
}
|
||||||
else sc->ceilingz += Sgn(s->z - sc->ceilingz) * s->yvel;
|
else sc->ceilingz += Sgn(s->z - sc->ceilingz) * s->yvel;
|
||||||
|
@ -4649,7 +4649,7 @@ void handle_se32(DDukeActor *actor)
|
||||||
{
|
{
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
t[2] = !t[2];
|
t[2] = !t[2];
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
}
|
}
|
||||||
else sc->ceilingz -= Sgn(s->z - t[1]) * s->yvel;
|
else sc->ceilingz -= Sgn(s->z - t[1]) * s->yvel;
|
||||||
}
|
}
|
||||||
|
@ -4810,7 +4810,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
|
||||||
t[2] = 0;
|
t[2] = 0;
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
if (choosedir) t[3] = s->hitag;
|
if (choosedir) t[3] = s->hitag;
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -4836,7 +4836,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
|
||||||
if (abs(sec->floorz - t[1]) < s->yvel)
|
if (abs(sec->floorz - t[1]) < s->yvel)
|
||||||
{
|
{
|
||||||
sec->floorz = t[1];
|
sec->floorz = t[1];
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
t[2] = 0;
|
t[2] = 0;
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
if (choosedir) t[3] = s->hitag;
|
if (choosedir) t[3] = s->hitag;
|
||||||
|
@ -4867,7 +4867,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
|
||||||
{
|
{
|
||||||
if (abs(s->z - sec->floorz) < s->yvel)
|
if (abs(s->z - sec->floorz) < s->yvel)
|
||||||
{
|
{
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
t[2] = 1;
|
t[2] = 1;
|
||||||
if (choosedir) t[3] = s->hitag;
|
if (choosedir) t[3] = s->hitag;
|
||||||
|
@ -4896,7 +4896,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
|
||||||
if (abs(sec->floorz - t[1]) < s->yvel)
|
if (abs(sec->floorz - t[1]) < s->yvel)
|
||||||
{
|
{
|
||||||
t[0] = 0;
|
t[0] = 0;
|
||||||
callsound(s->sectnum, actor);
|
callsound(s->sector(), actor);
|
||||||
t[2] = 1;
|
t[2] = 1;
|
||||||
t[3] = s->hitag;
|
t[3] = s->hitag;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3475,7 +3475,7 @@ void handle_se06_d(DDukeActor* actor)
|
||||||
DukeStatIterator it(STAT_EFFECTOR);
|
DukeStatIterator it(STAT_EFFECTOR);
|
||||||
while (auto act2 = it.Next())
|
while (auto act2 = it.Next())
|
||||||
{
|
{
|
||||||
if ((act2->s->lotag == 14) && (sh == act2->s->hitag) && (act2->temp_data[0] == t[0]))
|
if ((act2->s->lotag == 14) && (sh == act2->s->hitag) && (act2->temp_data[0] == t[0])) // sectnum()
|
||||||
{
|
{
|
||||||
act2->s->xvel = s->xvel;
|
act2->s->xvel = s->xvel;
|
||||||
//if( t[4] == 1 )
|
//if( t[4] == 1 )
|
||||||
|
|
|
@ -3441,7 +3441,7 @@ void handle_se06_r(DDukeActor *actor)
|
||||||
DukeStatIterator it(STAT_EFFECTOR);
|
DukeStatIterator it(STAT_EFFECTOR);
|
||||||
while (auto act2 = it.Next())
|
while (auto act2 = it.Next())
|
||||||
{
|
{
|
||||||
if ((act2->s->lotag == 14) && (sh == act2->s->hitag) && (act2->temp_data[0] == t[0]))
|
if ((act2->s->lotag == 14) && (sh == act2->s->hitag) && (act2->temp_data[0] == t[0])) // sectnum()
|
||||||
{
|
{
|
||||||
act2->s->xvel = s->xvel;
|
act2->s->xvel = s->xvel;
|
||||||
// if( t[4] == 1 )
|
// if( t[4] == 1 )
|
||||||
|
|
|
@ -137,7 +137,7 @@ int haskey(sectortype* sect, int snum);
|
||||||
void shootbloodsplat(DDukeActor* i, int p, int sx, int sy, int sz, int sa, int atwith, int BIGFORCE, int OOZFILTER, int NEWBEAST);
|
void shootbloodsplat(DDukeActor* i, int p, int sx, int sy, int sz, int sa, int atwith, int BIGFORCE, int OOZFILTER, int NEWBEAST);
|
||||||
|
|
||||||
void breakwall(int newpn, DDukeActor* spr, walltype* dawallnum);
|
void breakwall(int newpn, DDukeActor* spr, walltype* dawallnum);
|
||||||
int callsound(int sectnum,DDukeActor* snum);
|
int callsound(sectortype* sectnum,DDukeActor* snum);
|
||||||
int hitasprite(DDukeActor* snum,DDukeActor **hitSprite);
|
int hitasprite(DDukeActor* snum,DDukeActor **hitSprite);
|
||||||
int findplayer(const DDukeActor* s, int* dist);
|
int findplayer(const DDukeActor* s, int* dist);
|
||||||
void operatejaildoors(int hitag);
|
void operatejaildoors(int hitag);
|
||||||
|
|
|
@ -193,11 +193,6 @@ inline void doslopetilting(player_struct* p, double const scaleAdjust = 1)
|
||||||
p->horizon.calcviewpitch(p->pos.vec2, p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursectnum, scaleAdjust);
|
p->horizon.calcviewpitch(p->pos.vec2, p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursectnum, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int callsound(sectortype* sect, DDukeActor* snum)
|
|
||||||
{
|
|
||||||
return callsound(sectnum(sect), snum);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
|
@ -51,7 +51,7 @@ static int interptype[] = { Interp_Sect_Floorz, Interp_Sect_Ceilingz, Interp_Wal
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
static bool haltsoundhack;
|
static bool haltsoundhack;
|
||||||
|
|
||||||
int callsound(int sn, DDukeActor* whatsprite)
|
int callsound(sectortype* sn, DDukeActor* whatsprite)
|
||||||
{
|
{
|
||||||
if (!isRRRA() && haltsoundhack)
|
if (!isRRRA() && haltsoundhack)
|
||||||
{
|
{
|
||||||
|
@ -887,8 +887,8 @@ static void handle_st25(sectortype* sptr, DDukeActor* actor)
|
||||||
{
|
{
|
||||||
act3->getSector()->lotag ^= 0x8000; // Toggle the open or close
|
act3->getSector()->lotag ^= 0x8000; // Toggle the open or close
|
||||||
act3->s->ang += 1024;
|
act3->s->ang += 1024;
|
||||||
if (act3->temp_data[4]) callsound(act3->s->sectnum, act3);
|
if (act3->temp_data[4]) callsound(act3->getSector(), act3);
|
||||||
callsound(act3->s->sectnum, act3);
|
callsound(act3->getSector(), act3);
|
||||||
if (act3->getSector()->lotag & 0x8000) act3->temp_data[4] = 1;
|
if (act3->getSector()->lotag & 0x8000) act3->temp_data[4] = 1;
|
||||||
else act3->temp_data[4] = 2;
|
else act3->temp_data[4] = 2;
|
||||||
}
|
}
|
||||||
|
@ -1147,16 +1147,16 @@ void operateactivators(int low, int plnum)
|
||||||
case SE_31_FLOOR_RISE_FALL:
|
case SE_31_FLOOR_RISE_FALL:
|
||||||
case SE_32_CEILING_RISE_FALL:
|
case SE_32_CEILING_RISE_FALL:
|
||||||
a2->temp_data[0] = 1 - a2->temp_data[0];
|
a2->temp_data[0] = 1 - a2->temp_data[0];
|
||||||
callsound(act->s->sectnum, a2);
|
callsound(act->getSector(), a2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k == -1 && (act->getSector()->lotag & 0xff) == 22)
|
if (k == -1 && (act->getSector()->lotag & 0xff) == 22)
|
||||||
k = callsound(act->s->sectnum, act);
|
k = callsound(act->getSector(), act);
|
||||||
|
|
||||||
operatesectors(act->s->sector(), act);
|
operatesectors(act->getSector(), act);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -623,7 +623,6 @@ void spawneffector(DDukeActor* actor)
|
||||||
{
|
{
|
||||||
auto sp = actor->s;
|
auto sp = actor->s;
|
||||||
auto sectp = sp->sector();
|
auto sectp = sp->sector();
|
||||||
int sect = sp->sectnum;
|
|
||||||
auto t = actor->temp_data;
|
auto t = actor->temp_data;
|
||||||
int d, clostest = 0;
|
int d, clostest = 0;
|
||||||
|
|
||||||
|
@ -769,8 +768,8 @@ void spawneffector(DDukeActor* actor)
|
||||||
case SE_17_WARP_ELEVATOR:
|
case SE_17_WARP_ELEVATOR:
|
||||||
{
|
{
|
||||||
t[2] = sectp->floorz; //Stopping loc
|
t[2] = sectp->floorz; //Stopping loc
|
||||||
t[3] = nextsectorneighborzptr(sect, sectp->floorz, -1, -1)->ceilingz;
|
t[3] = nextsectorneighborzptr(sectp, sectp->floorz, -1, -1)->ceilingz;
|
||||||
t[4] = nextsectorneighborzptr(sect, sectp->ceilingz, 1, 1)->floorz;
|
t[4] = nextsectorneighborzptr(sectp, sectp->ceilingz, 1, 1)->floorz;
|
||||||
|
|
||||||
if (numplayers < 2)
|
if (numplayers < 2)
|
||||||
{
|
{
|
||||||
|
@ -1045,7 +1044,7 @@ void spawneffector(DDukeActor* actor)
|
||||||
case SE_6_SUBWAY:
|
case SE_6_SUBWAY:
|
||||||
case SE_14_SUBWAY_CAR:
|
case SE_14_SUBWAY_CAR:
|
||||||
{
|
{
|
||||||
int j = callsound(sect, actor);
|
int j = callsound(sectp, actor);
|
||||||
if (j == -1)
|
if (j == -1)
|
||||||
{
|
{
|
||||||
if (!isRR()) j = SUBWAY; // Duke
|
if (!isRR()) j = SUBWAY; // Duke
|
||||||
|
|
Loading…
Reference in a new issue