mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-11 03:31:43 +00:00
- made cursectnum et. al. real pointers.
This commit is contained in:
parent
f19f656dd9
commit
321608e5ac
20 changed files with 240 additions and 285 deletions
|
@ -1032,7 +1032,7 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
if (pp == Player+myconnectindex)
|
||||
{
|
||||
choose_snd = STD_RANDOM_RANGE(2<<8)>>8;
|
||||
if (FAFcansee(sp->x,sp->y,SPRITEp_TOS(sp),sp->sector(),pp->posx, pp->posy, pp->posz, pp->cursector()) && Facing(actor, u->targetActor))
|
||||
if (FAFcansee(sp->x,sp->y,SPRITEp_TOS(sp),sp->sector(),pp->posx, pp->posy, pp->posz, pp->cursector) && Facing(actor, u->targetActor))
|
||||
PlayerSound(fagsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
|
||||
}
|
||||
}
|
||||
|
@ -1047,7 +1047,7 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
if (pp == Player+myconnectindex)
|
||||
{
|
||||
choose_snd = STD_RANDOM_RANGE(3<<8)>>8;
|
||||
if (FAFcansee(sp->x,sp->y,SPRITEp_TOS(sp),sp->sector(),pp->posx, pp->posy, pp->posz, pp->cursector()) && Facing(actor, u->targetActor))
|
||||
if (FAFcansee(sp->x,sp->y,SPRITEp_TOS(sp),sp->sector(),pp->posx, pp->posy, pp->posz, pp->cursector) && Facing(actor, u->targetActor))
|
||||
PlayerSound(straightsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1091,8 +1091,8 @@ void CameraView(PLAYERp pp, int *tx, int *ty, int *tz, sectortype** tsect, binan
|
|||
ang_test = getincangle(ang.asbuild(), sp->ang) < sp->lotag;
|
||||
|
||||
FAFcansee_test =
|
||||
(FAFcansee(sp->x, sp->y, sp->z, sp->sector(), *tx, *ty, *tz, pp->cursector()) ||
|
||||
FAFcansee(sp->x, sp->y, sp->z, sp->sector(), *tx, *ty, *tz + SPRITEp_SIZE_Z(&pp->Actor()->s()), pp->cursector()));
|
||||
(FAFcansee(sp->x, sp->y, sp->z, sp->sector(), *tx, *ty, *tz, pp->cursector) ||
|
||||
FAFcansee(sp->x, sp->y, sp->z, sp->sector(), *tx, *ty, *tz + SPRITEp_SIZE_Z(&pp->Actor()->s()), pp->cursector));
|
||||
|
||||
player_in_camera = ang_test && FAFcansee_test;
|
||||
|
||||
|
@ -1429,7 +1429,7 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
int tx, ty, tz;
|
||||
binangle tang, trotscrnang;
|
||||
fixedhoriz thoriz;
|
||||
int tsectnum;
|
||||
sectortype* tsect;
|
||||
short i,j;
|
||||
int bob_amt = 0;
|
||||
int quake_z, quake_x, quake_y;
|
||||
|
@ -1437,10 +1437,6 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
extern bool FAF_DebugView;
|
||||
PLAYERp camerapp; // prediction player if prediction is on, else regular player
|
||||
|
||||
// last valid stuff
|
||||
static short lv_sectnum = -1;
|
||||
static int lv_x, lv_y, lv_z;
|
||||
|
||||
int const viewingRange = viewingrange;
|
||||
|
||||
DrawScreen = true;
|
||||
|
@ -1482,18 +1478,9 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
thoriz = pp->horizon.sum();
|
||||
trotscrnang = pp->angle.rotscrnang;
|
||||
}
|
||||
tsectnum = camerapp->cursectnum;
|
||||
tsect = camerapp->cursector;
|
||||
|
||||
updatesector(tx, ty, &tsectnum);
|
||||
|
||||
if (tsectnum >= 0)
|
||||
{
|
||||
// last valid stuff
|
||||
lv_sectnum = tsectnum;
|
||||
lv_x = tx;
|
||||
lv_y = ty;
|
||||
lv_z = tz;
|
||||
}
|
||||
updatesector(tx, ty, &tsect);
|
||||
|
||||
if (pp->sop_riding || pp->sop_control)
|
||||
{
|
||||
|
@ -1505,8 +1492,8 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
tz = pp->posz;
|
||||
tang = pp->angle.ang;
|
||||
}
|
||||
tsectnum = pp->cursectnum;
|
||||
updatesectorz(tx, ty, tz, &tsectnum);
|
||||
tsect = pp->cursector;
|
||||
updatesectorz(tx, ty, tz, &tsect);
|
||||
}
|
||||
|
||||
pp->six = tx;
|
||||
|
@ -1531,15 +1518,14 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
tang = bvectangbam(pp->sop_remote->xmid - tx, pp->sop_remote->ymid - ty);
|
||||
}
|
||||
|
||||
auto pSect = §or[tsectnum];
|
||||
if (TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
|
||||
{
|
||||
tz -= 8448;
|
||||
|
||||
if (!calcChaseCamPos(&tx, &ty, &tz, &pp->Actor()->s(), &pSect, tang, thoriz, smoothratio))
|
||||
if (!calcChaseCamPos(&tx, &ty, &tz, &pp->Actor()->s(), &tsect, tang, thoriz, smoothratio))
|
||||
{
|
||||
tz += 8448;
|
||||
calcChaseCamPos(&tx, &ty, &tz, &pp->Actor()->s(), &pSect, tang, thoriz, smoothratio);
|
||||
calcChaseCamPos(&tx, &ty, &tz, &pp->Actor()->s(), &tsect, tang, thoriz, smoothratio);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1548,10 +1534,9 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
|
||||
if (CameraTestMode)
|
||||
{
|
||||
CameraView(camerapp, &tx, &ty, &tz, &pSect, &tang, &thoriz);
|
||||
CameraView(camerapp, &tx, &ty, &tz, &tsect, &tang, &thoriz);
|
||||
}
|
||||
}
|
||||
tsectnum = sectnum(pSect);
|
||||
|
||||
if (!TEST(pp->Flags, PF_VIEW_FROM_CAMERA|PF_VIEW_FROM_OUTSIDE))
|
||||
{
|
||||
|
@ -1575,12 +1560,12 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
if (!testnewrenderer)
|
||||
{
|
||||
renderSetRollAngle((float)trotscrnang.asbuildf());
|
||||
polymost_drawscreen(pp, tx, ty, tz, tang, thoriz, pSect);
|
||||
polymost_drawscreen(pp, tx, ty, tz, tang, thoriz, tsect);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateWallPortalState();
|
||||
render_drawrooms(&pp->Actor()->s(), { tx, ty, tz }, tsectnum, tang, thoriz, trotscrnang, smoothratio);
|
||||
render_drawrooms(&pp->Actor()->s(), { tx, ty, tz }, sectnum(tsect), tang, thoriz, trotscrnang, smoothratio);
|
||||
RestorePortalState();
|
||||
}
|
||||
|
||||
|
@ -1595,7 +1580,7 @@ drawscreen(PLAYERp pp, double smoothratio)
|
|||
}
|
||||
|
||||
|
||||
MarkSectorSeen(pp->cursectnum);
|
||||
MarkSectorSeen(sectnum(pp->cursector));
|
||||
|
||||
if ((automapMode != am_off) && pp == Player+myconnectindex)
|
||||
{
|
||||
|
|
|
@ -327,7 +327,9 @@ void InitLevel(MapRecord *maprec)
|
|||
|
||||
int16_t ang;
|
||||
currentLevel = maprec;
|
||||
engineLoadBoard(maprec->fileName, SW_SHAREWARE ? 1 : 0, &Player[0].pos, &ang, &Player[0].cursectnum);
|
||||
int cursect;
|
||||
engineLoadBoard(maprec->fileName, SW_SHAREWARE ? 1 : 0, &Player[0].pos, &ang, &cursect);
|
||||
Player[0].cursector = §or[cursect];
|
||||
|
||||
SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name);
|
||||
STAT_NewLevel(currentLevel->fileName);
|
||||
|
|
|
@ -736,7 +736,6 @@ struct PLAYERstruct
|
|||
int oposx, oposy, oposz;
|
||||
|
||||
// holds last valid move position
|
||||
int lv_sectnum;
|
||||
int lv_x,lv_y,lv_z;
|
||||
|
||||
REMOTE_CONTROL remote;
|
||||
|
@ -768,12 +767,14 @@ struct PLAYERstruct
|
|||
int16_t circle_camera_ang;
|
||||
int16_t camera_check_time_delay;
|
||||
|
||||
int cursectnum,lastcursectnum;
|
||||
sectortype* cursector() { return cursectnum < 0? nullptr : §or[cursectnum]; }
|
||||
sectortype* lastcursector() { return lastcursectnum < 0 ? nullptr : §or[lastcursectnum]; }
|
||||
void setcursector(sectortype* s) { cursectnum = sectnum(s); }
|
||||
bool insector() const { return cursectnum >= 0; }
|
||||
void backupcursector() { lastcursectnum = cursectnum; }
|
||||
|
||||
sectortype
|
||||
* cursector,
|
||||
* lastcursector,
|
||||
* lv_sector;
|
||||
|
||||
void setcursector(sectortype* s) { cursector = s; }
|
||||
bool insector() const { return cursector != nullptr; }
|
||||
fixed_t turn180_target; // 180 degree turn
|
||||
|
||||
// variables that do not fit into sprite structure
|
||||
|
@ -904,8 +905,6 @@ struct PLAYERstruct
|
|||
int cookieTime;
|
||||
|
||||
uint8_t WpnReloadState;
|
||||
|
||||
sectortype* cursector() const { return §or[cursectnum]; }
|
||||
};
|
||||
|
||||
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];
|
||||
|
|
|
@ -417,7 +417,7 @@ void JS_InitMirrors(void)
|
|||
// Draw a 3d screen to a specific tile
|
||||
/////////////////////////////////////////////////////
|
||||
void drawroomstotile(int daposx, int daposy, int daposz,
|
||||
binangle ang, fixedhoriz horiz, short dacursectnum, short tilenume, double smoothratio)
|
||||
binangle ang, fixedhoriz horiz, sectortype* dacursect, short tilenume, double smoothratio)
|
||||
{
|
||||
auto canvas = renderSetTarget(tilenume);
|
||||
if (!canvas) return;
|
||||
|
@ -426,13 +426,13 @@ void drawroomstotile(int daposx, int daposy, int daposz,
|
|||
{
|
||||
if (!testnewrenderer)
|
||||
{
|
||||
renderDrawRoomsQ16(daposx, daposy, daposz, ang.asq16(), horiz.asq16(), dacursectnum, false);
|
||||
renderDrawRoomsQ16(daposx, daposy, daposz, ang.asq16(), horiz.asq16(), sectnum(dacursect), false);
|
||||
analyzesprites(pm_tsprite, pm_spritesortcnt, daposx, daposy, daposz, ang.asbuild());
|
||||
renderDrawMasks();
|
||||
}
|
||||
else
|
||||
{
|
||||
render_camtex(nullptr, { daposx, daposy, daposz }, dacursectnum, ang, horiz, buildang(0), tileGetTexture(tilenume), rect, smoothratio);
|
||||
render_camtex(nullptr, { daposx, daposy, daposz }, sectnum(dacursect), ang, horiz, buildang(0), tileGetTexture(tilenume), rect, smoothratio);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -657,11 +657,11 @@ void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio)
|
|||
|
||||
if (TEST_BOOL11(sp) && numplayers > 1)
|
||||
{
|
||||
drawroomstotile(cp->posx, cp->posy, cp->posz, cp->angle.ang, cp->horizon.horiz, cp->cursectnum, mirror[cnt].campic, smoothratio);
|
||||
drawroomstotile(cp->posx, cp->posy, cp->posz, cp->angle.ang, cp->horizon.horiz, cp->cursector, mirror[cnt].campic, smoothratio);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawroomstotile(sp->x, sp->y, sp->z, buildang(SP_TAG5(sp)), camhoriz, sp->sectnum, mirror[cnt].campic, smoothratio);
|
||||
drawroomstotile(sp->x, sp->y, sp->z, buildang(SP_TAG5(sp)), camhoriz, sp->sector(), mirror[cnt].campic, smoothratio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1315,7 +1315,7 @@ int PlayerInitChemBomb(PLAYERp pp)
|
|||
|
||||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, CHEMBOMB, s_ChemBomb, pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, CHEMBOMB, s_ChemBomb, pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), CHEMBOMB_VELOCITY);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -1738,7 +1738,7 @@ int PlayerInitCaltrops(PLAYERp pp)
|
|||
ny = pp->posy;
|
||||
nz = pp->posz + pp->bob_z + Z(8);
|
||||
|
||||
auto spawnedActor = SpawnActor(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, pp->cursector(),
|
||||
auto spawnedActor = SpawnActor(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), (CHEMBOMB_VELOCITY + RandomRange(CHEMBOMB_VELOCITY)) / 2);
|
||||
|
||||
wp = &spawnedActor->s();
|
||||
|
|
|
@ -64,10 +64,7 @@ Collision MultiClipMove(PLAYERp pp, int z, int floor_dist)
|
|||
xvect = sop->clipbox_vdist[i] * bcos(ang);
|
||||
yvect = sop->clipbox_vdist[i] * bsin(ang);
|
||||
Collision coll;
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
clipmove(spos, &cursect, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll, 1);
|
||||
pp->setcursector(cursect);
|
||||
clipmove(spos, &pp->cursector, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll, 1);
|
||||
|
||||
if (coll.type != kHitNone)
|
||||
{
|
||||
|
@ -100,10 +97,7 @@ Collision MultiClipMove(PLAYERp pp, int z, int floor_dist)
|
|||
pos[i].z = z;
|
||||
|
||||
// move the box
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
clipmove(pos[i], &cursect, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll);
|
||||
pp->setcursector(cursect);
|
||||
clipmove(pos[i], &pp->cursector, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
// save the dist moved
|
||||
dist = ksqrt(SQ(pos[i].x - opos[i].x) + SQ(pos[i].y - opos[i].y));
|
||||
|
@ -132,7 +126,7 @@ short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist)
|
|||
int x,y;
|
||||
short ang;
|
||||
int xvect, yvect;
|
||||
auto cursect = pp->cursector();
|
||||
auto cursect = pp->cursector;
|
||||
|
||||
for (i = 0; i < sop->clipbox_num; i++)
|
||||
{
|
||||
|
@ -206,7 +200,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
}
|
||||
|
||||
//Given the 4 points: x[4], y[4]
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector))
|
||||
{
|
||||
pp->posx += (pp->xvect>>14);
|
||||
pp->posy += (pp->yvect>>14);
|
||||
|
@ -223,7 +217,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
xy[i].x = qx[i] - (pp->yvect>>15);
|
||||
xy[i].y = qy[i] + (pp->xvect>>15);
|
||||
}
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector))
|
||||
{
|
||||
pp->posx -= (pp->yvect>>15);
|
||||
pp->posy += (pp->xvect>>15);
|
||||
|
@ -239,7 +233,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
xy[i].x = qx[i] + (pp->yvect>>15);
|
||||
xy[i].y = qy[i] - (pp->xvect>>15);
|
||||
}
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector))
|
||||
{
|
||||
pp->posx += (pp->yvect>>15);
|
||||
pp->posy -= (pp->xvect>>15);
|
||||
|
@ -290,7 +284,7 @@ short RectClipTurn(PLAYERp pp, short new_ang, int *qx, int *qy, int *ox, int *oy
|
|||
}
|
||||
|
||||
//Given the 4 points: x[4], y[4]
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector))
|
||||
{
|
||||
// move to new pos
|
||||
for (i = 0; i < 4; i++)
|
||||
|
|
|
@ -2360,7 +2360,7 @@ void InitPlayerSprite(PLAYERp pp)
|
|||
|
||||
COVER_SetReverb(0); // Turn off any echoing that may have been going before
|
||||
pp->Reverb = 0;
|
||||
auto actor = SpawnActor(STAT_PLAYER0 + pnum, NINJA_RUN_R0, nullptr, pp->cursector(), pp->posx,
|
||||
auto actor = SpawnActor(STAT_PLAYER0 + pnum, NINJA_RUN_R0, nullptr, pp->cursector, pp->posx,
|
||||
pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
|
||||
|
||||
pp->actor = actor;
|
||||
|
@ -2434,7 +2434,7 @@ void SpawnPlayerUnderSprite(PLAYERp pp)
|
|||
int pnum = int(pp - Player);
|
||||
|
||||
pp->PlayerUnderActor = SpawnActor(STAT_PLAYER_UNDER0 + pnum,
|
||||
NINJA_RUN_R0, nullptr, pp->cursector(), pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
|
||||
NINJA_RUN_R0, nullptr, pp->cursector, pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
|
||||
|
||||
sp = &pp->PlayerUnderActor->s();
|
||||
u = pp->PlayerUnderActor->u();
|
||||
|
|
|
@ -6719,7 +6719,7 @@ pDisplaySprites(PLAYERp pp, double smoothratio)
|
|||
int16_t floorshade = 0;
|
||||
if (pp->insector())
|
||||
{
|
||||
sectp = pp->cursector();
|
||||
sectp = pp->cursector;
|
||||
pal = sectp->floorpal;
|
||||
floorshade = sectp->floorshade;
|
||||
|
||||
|
@ -6740,7 +6740,7 @@ pDisplaySprites(PLAYERp pp, double smoothratio)
|
|||
SET(flags, RS_TRANS1);
|
||||
}
|
||||
|
||||
//shade = overlay_shade = DIV2(pp->cursector()->floorshade + pp->cursector()->ceilingshade);
|
||||
//shade = overlay_shade = DIV2(pp->cursector->floorshade + pp->cursector->ceilingshade);
|
||||
shade = overlay_shade = floorshade - 10;
|
||||
|
||||
if (TEST(psp->PlayerP->Flags, PF_VIEW_FROM_OUTSIDE))
|
||||
|
|
|
@ -1265,7 +1265,7 @@ void DoPlayerTeleportPause(PLAYERp pp)
|
|||
USERp u = pp->Actor()->u();
|
||||
|
||||
// set this so we don't get stuck in teleporting loop
|
||||
pp->backupcursector();
|
||||
pp->lastcursector = pp->cursector;
|
||||
|
||||
if ((u->WaitTics-=synctics) <= 0)
|
||||
{
|
||||
|
@ -1288,7 +1288,7 @@ void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang)
|
|||
|
||||
pp->posz = pp->oposz = sp->z - PLAYER_HEIGHT;
|
||||
|
||||
updatesector(pp->posx, pp->posy, &pp->cursectnum);
|
||||
updatesector(pp->posx, pp->posy, &pp->cursector);
|
||||
SET(pp->Flags2, PF2_TELEPORTED);
|
||||
}
|
||||
|
||||
|
@ -1297,7 +1297,7 @@ void DoPlayerTeleportToOffset(PLAYERp pp)
|
|||
pp->oposx = pp->oldposx = pp->posx;
|
||||
pp->oposy = pp->oldposy = pp->posy;
|
||||
|
||||
updatesector(pp->posx, pp->posy, &pp->cursectnum);
|
||||
updatesector(pp->posx, pp->posy, &pp->cursector);
|
||||
SET(pp->Flags2, PF2_TELEPORTED);
|
||||
}
|
||||
|
||||
|
@ -1370,14 +1370,10 @@ void DoPlayerWarpTeleporter(PLAYERp pp)
|
|||
TAG 5 to 8 = random match locations
|
||||
#endif
|
||||
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
auto cursect = pp->cursector();
|
||||
if ((act_warp = Warp(&pp->posx, &pp->posy, &pp->posz, &cursect)) == nullptr)
|
||||
if ((act_warp = Warp(&pp->posx, &pp->posy, &pp->posz, &pp->cursector)) == nullptr)
|
||||
{
|
||||
pp->setcursector(cursect);
|
||||
return;
|
||||
}
|
||||
pp->setcursector(cursect);
|
||||
|
||||
sp_warp = &act_warp->s();
|
||||
switch (SP_TAG3(sp_warp))
|
||||
|
@ -1412,7 +1408,7 @@ void DoPlayerWarpTeleporter(PLAYERp pp)
|
|||
PLAYERp npp = &Player[pnum];
|
||||
|
||||
// if someone already standing there
|
||||
if (npp->cursectnum == pp->cursectnum)
|
||||
if (npp->cursector == pp->cursector)
|
||||
{
|
||||
PlayerUpdateHealth(npp, -npp->Actor()->u()->Health); // Make sure he dies!
|
||||
// telefraged by teleporting player
|
||||
|
@ -1596,28 +1592,28 @@ void SlipSlope(PLAYERp pp)
|
|||
{
|
||||
short ang;
|
||||
|
||||
if (!pp->insector() || !pp->cursector()->hasU())
|
||||
if (!pp->insector() || !pp->cursector->hasU())
|
||||
return;
|
||||
|
||||
auto sectu = pp->cursector();
|
||||
auto sectu = pp->cursector;
|
||||
|
||||
if (!TEST(sectu->flags, SECTFU_SLIDE_SECTOR) || !TEST(pp->cursector()->floorstat, FLOOR_STAT_SLOPE))
|
||||
if (!TEST(sectu->flags, SECTFU_SLIDE_SECTOR) || !TEST(pp->cursector->floorstat, FLOOR_STAT_SLOPE))
|
||||
return;
|
||||
|
||||
auto wallptr = pp->cursector()->firstWall();
|
||||
auto wallptr = pp->cursector->firstWall();
|
||||
|
||||
ang = getangle(wallptr->delta());
|
||||
|
||||
ang = NORM_ANGLE(ang + 512);
|
||||
|
||||
pp->xvect += MulScale(bcos(ang), pp->cursector()->floorheinum, sectu->speed);
|
||||
pp->yvect += MulScale(bsin(ang), pp->cursector()->floorheinum, sectu->speed);
|
||||
pp->xvect += MulScale(bcos(ang), pp->cursector->floorheinum, sectu->speed);
|
||||
pp->yvect += MulScale(bsin(ang), pp->cursector->floorheinum, sectu->speed);
|
||||
}
|
||||
|
||||
void DoPlayerHorizon(PLAYERp pp, float const horz, double const scaleAdjust)
|
||||
{
|
||||
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(pp->cursector()->floorstat, FLOOR_STAT_SLOPE);
|
||||
pp->horizon.calcviewpitch(pp->pos.vec2, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursector(), scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
|
||||
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(pp->cursector->floorstat, FLOOR_STAT_SLOPE);
|
||||
pp->horizon.calcviewpitch(pp->pos.vec2, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursector, scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
|
||||
pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust);
|
||||
}
|
||||
|
||||
|
@ -1783,7 +1779,7 @@ void UpdatePlayerSprite(PLAYERp pp)
|
|||
// there are multiple death functions
|
||||
if (TEST(pp->Flags, PF_DEAD))
|
||||
{
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
sp->ang = pp->angle.ang.asbuild();
|
||||
UpdatePlayerUnderSprite(pp);
|
||||
return;
|
||||
|
@ -1791,25 +1787,25 @@ void UpdatePlayerSprite(PLAYERp pp)
|
|||
|
||||
if (pp->sop_control)
|
||||
{
|
||||
sp->z = pp->cursector()->floorz;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
sp->z = pp->cursector->floorz;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
else if (pp->DoPlayerAction == DoPlayerCrawl)
|
||||
{
|
||||
sp->z = pp->posz + PLAYER_CRAWL_HEIGHT;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
#if 0
|
||||
else if (pp->DoPlayerAction == DoPlayerSwim)
|
||||
{
|
||||
sp->z = pp->loz - Z(pp->WadeDepth) + Z(1);
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
#endif
|
||||
else if (pp->DoPlayerAction == DoPlayerWade)
|
||||
{
|
||||
sp->z = pp->posz + PLAYER_HEIGHT;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
|
||||
if (pp->WadeDepth > Z(29))
|
||||
{
|
||||
|
@ -1820,7 +1816,7 @@ void UpdatePlayerSprite(PLAYERp pp)
|
|||
{
|
||||
// bobbing and sprite position taken care of in DoPlayerDive
|
||||
sp->z = pp->posz + Z(10);
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
else if (pp->DoPlayerAction == DoPlayerClimb)
|
||||
{
|
||||
|
@ -1830,7 +1826,7 @@ void UpdatePlayerSprite(PLAYERp pp)
|
|||
//sp->x += MOVEx(256+64, sp->ang);
|
||||
//sp->y += MOVEy(256+64, sp->ang);
|
||||
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
else if (pp->DoPlayerAction == DoPlayerFly)
|
||||
{
|
||||
|
@ -1839,22 +1835,22 @@ void UpdatePlayerSprite(PLAYERp pp)
|
|||
//sp->z = pp->posz + PLAYER_HEIGHT;
|
||||
//DoPlayerSpriteBob(pp, PLAYER_HEIGHT, PLAYER_FLY_BOB_AMT, 3);
|
||||
DoPlayerSpriteBob(pp, PLAYER_HEIGHT, Z(6), 3);
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
else if (pp->DoPlayerAction == DoPlayerJump || pp->DoPlayerAction == DoPlayerFall || pp->DoPlayerAction == DoPlayerForceJump)
|
||||
{
|
||||
sp->z = pp->posz + PLAYER_HEIGHT;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
else if (pp->DoPlayerAction == DoPlayerTeleportPause)
|
||||
{
|
||||
sp->z = pp->posz + PLAYER_HEIGHT;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
else
|
||||
{
|
||||
sp->z = pp->loz;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
}
|
||||
|
||||
UpdatePlayerUnderSprite(pp);
|
||||
|
@ -1876,7 +1872,7 @@ void DoPlayerZrange(PLAYERp pp)
|
|||
RESET(sp->cstat, CSTAT_SPRITE_BLOCK);
|
||||
vec3_t pos = pp->pos;
|
||||
pos.z += Z(8);
|
||||
FAFgetzrange(pos, pp->cursectnum, &pp->hiz, &ceilhit, &pp->loz, &florhit, ((int)sp->clipdist<<2) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER);
|
||||
FAFgetzrange(pos, sectnum(pp->cursector), &pp->hiz, &ceilhit, &pp->loz, &florhit, ((int)sp->clipdist<<2) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER);
|
||||
sp->cstat = bakcstat;
|
||||
|
||||
Collision ceilColl(ceilhit);
|
||||
|
@ -1935,7 +1931,7 @@ void DoPlayerSlide(PLAYERp pp)
|
|||
if (labs(pp->slide_xvect) < 12800 && labs(pp->slide_yvect) < 12800)
|
||||
pp->slide_xvect = pp->slide_yvect = 0;
|
||||
|
||||
push_ret = pushmove(&pp->pos, &pp->cursectnum, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!TEST(pp->Flags, PF_DEAD))
|
||||
|
@ -1949,13 +1945,10 @@ void DoPlayerSlide(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
Collision coll;
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
clipmove(pp->pos, &cursect, pp->slide_xvect, pp->slide_yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
pp->setcursector(cursect);
|
||||
clipmove(pp->pos, &pp->cursector, pp->slide_xvect, pp->slide_yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
PlayerCheckValidMove(pp);
|
||||
push_ret = pushmove(&pp->pos, &pp->cursectnum, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!TEST(pp->Flags, PF_DEAD))
|
||||
|
@ -1979,7 +1972,7 @@ void PlayerCheckValidMove(PLAYERp pp)
|
|||
pp->posx = pp->oldposx;
|
||||
pp->posy = pp->oldposy;
|
||||
pp->posz = pp->oldposz;
|
||||
pp->cursectnum = pp->lastcursectnum;
|
||||
pp->cursector = pp->lastcursector;
|
||||
|
||||
// if stuck here for more than 10 seconds
|
||||
if (count++ > 40 * 10)
|
||||
|
@ -2005,7 +1998,7 @@ void PlayerSectorBound(PLAYERp pp, int amt)
|
|||
// called from DoPlayerMove() but can be called
|
||||
// from anywhere it is needed
|
||||
|
||||
getzsofslopeptr(pp->cursector(), pp->posx, pp->posy, &cz, &fz);
|
||||
getzsofslopeptr(pp->cursector, pp->posx, pp->posy, &cz, &fz);
|
||||
|
||||
if (pp->posz > fz - amt)
|
||||
pp->posz = fz - amt;
|
||||
|
@ -2045,7 +2038,7 @@ void DoPlayerMove(PLAYERp pp)
|
|||
pp->oldposx = pp->posx;
|
||||
pp->oldposy = pp->posy;
|
||||
pp->oldposz = pp->posz;
|
||||
pp->backupcursector();
|
||||
pp->lastcursector = pp->cursector;
|
||||
|
||||
if (PLAYER_MOVING(pp) == 0)
|
||||
RESET(pp->Flags, PF_PLAYER_MOVED);
|
||||
|
@ -2089,7 +2082,7 @@ void DoPlayerMove(PLAYERp pp)
|
|||
|
||||
if (TEST(pp->Flags, PF_CLIP_CHEAT))
|
||||
{
|
||||
int sectnum = pp->cursectnum;
|
||||
auto sect = pp->cursector;
|
||||
if (interpolate_ride)
|
||||
{
|
||||
pp->oposx = pp->posx;
|
||||
|
@ -2097,13 +2090,13 @@ void DoPlayerMove(PLAYERp pp)
|
|||
}
|
||||
pp->posx += pp->xvect >> 14;
|
||||
pp->posy += pp->yvect >> 14;
|
||||
updatesector(pp->posx, pp->posy, §num);
|
||||
if (sectnum != -1)
|
||||
pp->cursectnum = sectnum;
|
||||
updatesector(pp->posx, pp->posy, §);
|
||||
if (sect != nullptr)
|
||||
pp->cursector = sect;
|
||||
}
|
||||
else
|
||||
{
|
||||
push_ret = pushmove(&pp->pos, &pp->cursectnum, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
|
||||
if (push_ret < 0)
|
||||
{
|
||||
|
@ -2126,16 +2119,13 @@ void DoPlayerMove(PLAYERp pp)
|
|||
save_cstat = sp->cstat;
|
||||
RESET(sp->cstat, CSTAT_SPRITE_BLOCK);
|
||||
Collision coll;
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
updatesector(pp->posx, pp->posy, &cursect);
|
||||
clipmove(pp->pos, &cursect, pp->xvect, pp->yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
pp->setcursector(cursect);
|
||||
updatesector(pp->posx, pp->posy, &pp->cursector);
|
||||
clipmove(pp->pos, &pp->cursector, pp->xvect, pp->yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
sp->cstat = save_cstat;
|
||||
PlayerCheckValidMove(pp);
|
||||
|
||||
push_ret = pushmove(&pp->pos, &pp->cursectnum, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist - Z(16), CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
|
||||
|
@ -2157,14 +2147,10 @@ void DoPlayerMove(PLAYERp pp)
|
|||
}
|
||||
|
||||
// check for warp - probably can remove from CeilingHit
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
if (WarpPlane(&pp->posx, &pp->posy, &pp->posz, &cursect))
|
||||
if (WarpPlane(&pp->posx, &pp->posy, &pp->posz, &pp->cursector))
|
||||
{
|
||||
pp->setcursector(cursect);
|
||||
PlayerWarpUpdatePos(pp);
|
||||
}
|
||||
pp->setcursector(cursect);
|
||||
|
||||
DoPlayerZrange(pp);
|
||||
|
||||
|
@ -2181,7 +2167,7 @@ void DoPlayerMove(PLAYERp pp)
|
|||
DoPlayerHorizon(pp, pp->input.horz, 1);
|
||||
}
|
||||
|
||||
if (pp->insector() && TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
if (pp->insector() && TEST(pp->cursector->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
if (TEST(pp->Flags, PF_FLYING|PF_JUMPING|PF_FALLING))
|
||||
{
|
||||
|
@ -2204,17 +2190,17 @@ void DoPlayerMove(PLAYERp pp)
|
|||
|
||||
void DoPlayerSectorUpdatePreMove(PLAYERp pp)
|
||||
{
|
||||
auto sect = pp->cursector();
|
||||
auto sect = pp->cursector;
|
||||
|
||||
if (sect == nullptr)
|
||||
return;
|
||||
|
||||
if (TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
if (TEST(pp->cursector->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, §);
|
||||
if (sect == nullptr)
|
||||
{
|
||||
sect = pp->cursector();
|
||||
sect = pp->cursector;
|
||||
updatesector(pp->posx, pp->posy, §);
|
||||
}
|
||||
ASSERT(sect);
|
||||
|
@ -2224,7 +2210,7 @@ void DoPlayerSectorUpdatePreMove(PLAYERp pp)
|
|||
updatesectorz(pp->posx, pp->posy, pp->posz, §);
|
||||
if (sect == nullptr)
|
||||
{
|
||||
sect = pp->cursector();
|
||||
sect = pp->cursector;
|
||||
updatesector(pp->posx, pp->posy, §);
|
||||
}
|
||||
ASSERT(sect);
|
||||
|
@ -2235,13 +2221,13 @@ void DoPlayerSectorUpdatePreMove(PLAYERp pp)
|
|||
|
||||
void DoPlayerSectorUpdatePostMove(PLAYERp pp)
|
||||
{
|
||||
auto sect = pp->cursector();
|
||||
auto sect = pp->cursector;
|
||||
int fz,cz;
|
||||
|
||||
// need to do updatesectorz if in connect area
|
||||
if (sect != nullptr && FAF_ConnectArea(sect))
|
||||
{
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, &pp->cursectnum);
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, &pp->cursector);
|
||||
|
||||
// can mess up if below
|
||||
if (!pp->insector())
|
||||
|
@ -2249,7 +2235,7 @@ void DoPlayerSectorUpdatePostMove(PLAYERp pp)
|
|||
pp->setcursector(sect);
|
||||
|
||||
// adjust the posz to be in a sector
|
||||
getzsofslopeptr(pp->cursector(), pp->posx, pp->posy, &cz, &fz);
|
||||
getzsofslopeptr(pp->cursector, pp->posx, pp->posy, &cz, &fz);
|
||||
if (pp->posz > fz)
|
||||
pp->posz = fz;
|
||||
|
||||
|
@ -2257,7 +2243,7 @@ void DoPlayerSectorUpdatePostMove(PLAYERp pp)
|
|||
pp->posz = cz;
|
||||
|
||||
// try again
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, &pp->cursectnum);
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, &pp->cursector);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2572,7 +2558,6 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
{
|
||||
int z;
|
||||
int floor_dist;
|
||||
short save_sectnum;
|
||||
auto actor = pp->sop->sp_child;
|
||||
SPRITEp sp = &actor->s();
|
||||
auto psp = &pp->Actor()->s();
|
||||
|
@ -2636,7 +2621,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
if (labs(pp->xvect) < 12800 && labs(pp->yvect) < 12800)
|
||||
pp->xvect = pp->yvect = 0;
|
||||
|
||||
pp->backupcursector();
|
||||
pp->lastcursector = pp->cursector;
|
||||
z = pp->posz + Z(10);
|
||||
|
||||
if (RectClip)
|
||||
|
@ -2663,7 +2648,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
PRODUCTION_ASSERT(count == 4);
|
||||
}
|
||||
|
||||
save_sectnum = pp->cursectnum;
|
||||
auto save_sect = pp->cursector;
|
||||
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), MAXSO, MAXSO);
|
||||
pp->setcursector(pp->sop->op_main_sector); // for speed
|
||||
|
||||
|
@ -2690,9 +2675,9 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
|
||||
if (vel > 13000)
|
||||
{
|
||||
vec3_t hit_pos = { DIV2(x[0] + x[1]), DIV2(y[0] + y[1]), pp->cursector()->floorz - Z(10) };
|
||||
vec3_t hit_pos = { DIV2(x[0] + x[1]), DIV2(y[0] + y[1]), pp->cursector->floorz - Z(10) };
|
||||
|
||||
hitscan(hit_pos, pp->cursector(),
|
||||
hitscan(hit_pos, pp->cursector,
|
||||
{ MOVEx(256, pp->angle.ang.asbuild()), MOVEy(256, pp->angle.ang.asbuild()), 0 },
|
||||
hit, CLIPMASK_PLAYER);
|
||||
|
||||
|
@ -2737,10 +2722,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
{
|
||||
vec3_t clippos = { pp->posx, pp->posy, z };
|
||||
Collision coll;
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
clipmove(clippos, &cursect, pp->xvect, pp->yvect, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, u->coll);
|
||||
pp->setcursector(cursect);
|
||||
clipmove(clippos, &pp->cursector, pp->xvect, pp->yvect, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, u->coll);
|
||||
|
||||
pp->pos.vec2 = clippos.vec2;
|
||||
}
|
||||
|
@ -2773,7 +2755,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
|||
}
|
||||
|
||||
OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->posx, pp->posy);
|
||||
pp->cursectnum = save_sectnum; // for speed
|
||||
pp->cursector = save_sect; // for speed
|
||||
|
||||
if (!SyncInput())
|
||||
{
|
||||
|
@ -3018,9 +3000,9 @@ void DoPlayerBeginFall(PLAYERp pp)
|
|||
|
||||
void StackedWaterSplash(PLAYERp pp)
|
||||
{
|
||||
if (FAF_ConnectArea(pp->cursector()))
|
||||
if (FAF_ConnectArea(pp->cursector))
|
||||
{
|
||||
auto sectnum = pp->cursector();
|
||||
auto sectnum = pp->cursector;
|
||||
|
||||
auto psp = &pp->Actor()->s();
|
||||
updatesectorz(pp->posx, pp->posy, SPRITEp_BOS(psp), §num);
|
||||
|
@ -3044,7 +3026,7 @@ void DoPlayerFall(PLAYERp pp)
|
|||
pp->KeyPressBits |= SB_JUMP;
|
||||
}
|
||||
|
||||
if (SectorIsUnderwaterArea(pp->cursector()))
|
||||
if (SectorIsUnderwaterArea(pp->cursector))
|
||||
{
|
||||
StackedWaterSplash(pp);
|
||||
DoPlayerBeginDiveNoWarp(pp);
|
||||
|
@ -3075,7 +3057,7 @@ void DoPlayerFall(PLAYERp pp)
|
|||
|
||||
|
||||
|
||||
depth = GetZadjustment(pp->cursector(), FLOOR_Z_ADJUST)>>8;
|
||||
depth = GetZadjustment(pp->cursector, FLOOR_Z_ADJUST)>>8;
|
||||
if (depth == 0)
|
||||
depth = pp->WadeDepth;
|
||||
|
||||
|
@ -3096,7 +3078,7 @@ void DoPlayerFall(PLAYERp pp)
|
|||
|
||||
if (PlayerFloorHit(pp, pp->loz - PLAYER_HEIGHT + recoil_amt))
|
||||
{
|
||||
SECTORp sectp = pp->cursector();
|
||||
SECTORp sectp = pp->cursector;
|
||||
|
||||
PlayerSectorBound(pp, Z(1));
|
||||
|
||||
|
@ -3380,7 +3362,7 @@ void DoPlayerClimb(PLAYERp pp)
|
|||
|
||||
// setsprite to players location
|
||||
sp->z = pp->posz + PLAYER_HEIGHT;
|
||||
ChangeActorSect(pp->Actor(), pp->cursector());
|
||||
ChangeActorSect(pp->Actor(), pp->cursector);
|
||||
|
||||
if (!SyncInput())
|
||||
{
|
||||
|
@ -3391,21 +3373,17 @@ void DoPlayerClimb(PLAYERp pp)
|
|||
DoPlayerHorizon(pp, pp->input.horz, 1);
|
||||
}
|
||||
|
||||
if (FAF_ConnectArea(pp->cursector()))
|
||||
if (FAF_ConnectArea(pp->cursector))
|
||||
{
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, &pp->cursectnum);
|
||||
updatesectorz(pp->posx, pp->posy, pp->posz, &pp->cursector);
|
||||
LadderUpdate = true;
|
||||
}
|
||||
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
if (WarpPlane(&pp->posx, &pp->posy, &pp->posz, &cursect))
|
||||
if (WarpPlane(&pp->posx, &pp->posy, &pp->posz, &pp->cursector))
|
||||
{
|
||||
pp->setcursector(cursect);
|
||||
PlayerWarpUpdatePos(pp);
|
||||
LadderUpdate = true;
|
||||
}
|
||||
pp->setcursector(cursect);
|
||||
|
||||
if (LadderUpdate)
|
||||
{
|
||||
|
@ -3414,7 +3392,7 @@ void DoPlayerClimb(PLAYERp pp)
|
|||
|
||||
// constantly look for new ladder sector because of warping at any time
|
||||
neartag(pp->posx, pp->posy, pp->posz,
|
||||
pp->cursectnum, pp->angle.ang.asbuild(),
|
||||
sectnum(pp->cursector), pp->angle.ang.asbuild(),
|
||||
&sec, &wal, &spr,
|
||||
&dist, 800L, NTAG_SEARCH_LO_HI, nullptr);
|
||||
|
||||
|
@ -3451,13 +3429,13 @@ int DoPlayerWadeSuperJump(PLAYERp pp)
|
|||
unsigned i;
|
||||
//short angs[3];
|
||||
static short angs[3] = {0, 0, 0};
|
||||
int zh = pp->cursector()->floorz - Z(pp->WadeDepth) - Z(2);
|
||||
int zh = pp->cursector->floorz - Z(pp->WadeDepth) - Z(2);
|
||||
|
||||
if (Prediction) return false; // !JIM! 8/5/97 Teleporter FAFhitscan SuperJump bug.
|
||||
|
||||
for (i = 0; i < SIZ(angs); i++)
|
||||
{
|
||||
FAFhitscan(pp->posx, pp->posy, zh, pp->cursector(), // Start position
|
||||
FAFhitscan(pp->posx, pp->posy, zh, pp->cursector, // Start position
|
||||
bcos(pp->angle.ang.asbuild() + angs[i]), // X vector of 3D ang
|
||||
bsin(pp->angle.ang.asbuild() + angs[i]), // Y vector of 3D ang
|
||||
0, hit, CLIPMASK_MISSILE); // Z vector of 3D ang
|
||||
|
@ -3516,7 +3494,7 @@ bool PlayerFallTest(PLAYERp pp, int player_height)
|
|||
if (pp->lo_sectp &&
|
||||
labs(pp->lo_sectp->floorheinum) > 3000 &&
|
||||
TEST(pp->lo_sectp->floorstat, FLOOR_STAT_SLOPE) &&
|
||||
pp->lo_sectp == pp->lastcursector())
|
||||
pp->lo_sectp == pp->lastcursector)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -3535,13 +3513,13 @@ void DoPlayerCrawl(PLAYERp pp)
|
|||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
|
||||
if (SectorIsUnderwaterArea(pp->cursector()))
|
||||
if (SectorIsUnderwaterArea(pp->cursector))
|
||||
{
|
||||
// if stacked water - which it should be
|
||||
if (FAF_ConnectArea(pp->cursector()))
|
||||
if (FAF_ConnectArea(pp->cursector))
|
||||
{
|
||||
// adjust the z
|
||||
pp->posz = pp->cursector()->ceilingz + Z(12);
|
||||
pp->posz = pp->cursector->ceilingz + Z(12);
|
||||
}
|
||||
|
||||
DoPlayerBeginDiveNoWarp(pp);
|
||||
|
@ -3593,7 +3571,7 @@ void DoPlayerCrawl(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pp->insector() && TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
if (pp->insector() && TEST(pp->cursector->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
pp->posz = pp->loz - PLAYER_CRAWL_HEIGHT;
|
||||
}
|
||||
|
@ -3663,7 +3641,7 @@ bool PlayerFloorHit(PLAYERp pp, int zlimit)
|
|||
|
||||
void DoPlayerFly(PLAYERp pp)
|
||||
{
|
||||
if (SectorIsUnderwaterArea(pp->cursector()))
|
||||
if (SectorIsUnderwaterArea(pp->cursector))
|
||||
{
|
||||
DoPlayerBeginDiveNoWarp(pp);
|
||||
return;
|
||||
|
@ -3765,7 +3743,7 @@ bool PlayerOnLadder(PLAYERp pp)
|
|||
if (Prediction)
|
||||
return false;
|
||||
|
||||
neartag(pp->posx, pp->posy, pp->posz, pp->cursectnum, pp->angle.ang.asbuild(),
|
||||
neartag(pp->posx, pp->posy, pp->posz, sectnum(pp->cursector), pp->angle.ang.asbuild(),
|
||||
&neartagsector, &neartagwall, &neartagsprite,
|
||||
&neartaghitdist, 1024L+768L, NTAG_SEARCH_LO_HI, nullptr);
|
||||
|
||||
|
@ -3779,14 +3757,14 @@ bool PlayerOnLadder(PLAYERp pp)
|
|||
|
||||
for (i = 0; i < SIZ(angles); i++)
|
||||
{
|
||||
neartag(pp->posx, pp->posy, pp->posz, pp->cursectnum, NORM_ANGLE(pp->angle.ang.asbuild() + angles[i]),
|
||||
neartag(pp->posx, pp->posy, pp->posz, sectnum(pp->cursector), NORM_ANGLE(pp->angle.ang.asbuild() + angles[i]),
|
||||
&sec, &wal, &spr,
|
||||
&dist, 600L, NTAG_SEARCH_LO_HI, nullptr);
|
||||
|
||||
if (wal < 0 || dist < 100 || wall[wal].lotag != TAG_WALL_CLIMB)
|
||||
return false;
|
||||
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz, pp->cursector(),
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz, pp->cursector,
|
||||
bcos(pp->angle.ang.asbuild() + angles[i]),
|
||||
bsin(pp->angle.ang.asbuild() + angles[i]),
|
||||
0,
|
||||
|
@ -3857,7 +3835,7 @@ int PlayerInDiveArea(PLAYERp pp)
|
|||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//Attention: This changed on 07/29/97
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
sectp = pp->cursector();
|
||||
sectp = pp->cursector;
|
||||
//sectp = pp->lo_sectp;
|
||||
}
|
||||
else
|
||||
|
@ -3906,9 +3884,9 @@ int PlayerCanDiveNoWarp(PLAYERp pp)
|
|||
// check for diving
|
||||
if (pp->jump_speed > 1400)
|
||||
{
|
||||
if (FAF_ConnectArea(pp->cursector()))
|
||||
if (FAF_ConnectArea(pp->cursector))
|
||||
{
|
||||
auto sect = pp->cursector();
|
||||
auto sect = pp->cursector;
|
||||
|
||||
updatesectorz(pp->posx, pp->posy, SPRITEp_BOS(&pp->Actor()->s()), §);
|
||||
|
||||
|
@ -4096,7 +4074,7 @@ int GetOverlapSector2(int x, int y, sectortype** over, sectortype** under)
|
|||
void DoPlayerWarpToUnderwater(PLAYERp pp)
|
||||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
auto sectu = pp->cursector();
|
||||
auto sectu = pp->cursector;
|
||||
SPRITEp under_sp = nullptr, over_sp = nullptr;
|
||||
bool Found = false;
|
||||
|
||||
|
@ -4170,7 +4148,7 @@ void DoPlayerWarpToUnderwater(PLAYERp pp)
|
|||
void DoPlayerWarpToSurface(PLAYERp pp)
|
||||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
auto sectu = pp->cursector();
|
||||
auto sectu = pp->cursector;
|
||||
|
||||
SPRITEp under_sp = nullptr, over_sp = nullptr;
|
||||
bool Found = false;
|
||||
|
@ -4321,7 +4299,7 @@ void DoPlayerBeginDiveNoWarp(PLAYERp pp)
|
|||
if (Prediction)
|
||||
return;
|
||||
|
||||
if (!SectorIsUnderwaterArea(pp->cursector()))
|
||||
if (!SectorIsUnderwaterArea(pp->cursector))
|
||||
return;
|
||||
|
||||
if (pp->Bloody) pp->Bloody = false; // Water washes away the blood
|
||||
|
@ -4460,10 +4438,10 @@ void DoPlayerDiveMeter(PLAYERp pp)
|
|||
void DoPlayerDive(PLAYERp pp)
|
||||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
auto sectu = pp->cursector();
|
||||
auto sectu = pp->cursector;
|
||||
|
||||
// whenever your view is not in a water area
|
||||
if (!SectorIsUnderwaterArea(pp->cursector()))
|
||||
if (!SectorIsUnderwaterArea(pp->cursector))
|
||||
{
|
||||
DoPlayerStopDiveNoWarp(pp);
|
||||
DoPlayerBeginRun(pp);
|
||||
|
@ -4525,20 +4503,20 @@ void DoPlayerDive(PLAYERp pp)
|
|||
|
||||
pp->posz += pp->z_speed;
|
||||
|
||||
if (pp->z_speed < 0 && FAF_ConnectArea(pp->cursector()))
|
||||
if (pp->z_speed < 0 && FAF_ConnectArea(pp->cursector))
|
||||
{
|
||||
if (pp->posz < pp->cursector()->ceilingz + Z(10))
|
||||
if (pp->posz < pp->cursector->ceilingz + Z(10))
|
||||
{
|
||||
auto sect = pp->cursector();
|
||||
auto sect = pp->cursector;
|
||||
|
||||
// check for sector above to see if it is an underwater sector also
|
||||
updatesectorz(pp->posx, pp->posy, pp->cursector()->ceilingz - Z(8), §);
|
||||
updatesectorz(pp->posx, pp->posy, pp->cursector->ceilingz - Z(8), §);
|
||||
|
||||
if (!SectorIsUnderwaterArea(sect))
|
||||
{
|
||||
// if not underwater sector we must surface
|
||||
// force into above sector
|
||||
pp->posz = pp->cursector()->ceilingz - Z(8);
|
||||
pp->posz = pp->cursector->ceilingz - Z(8);
|
||||
pp->setcursector(sect);
|
||||
DoPlayerStopDiveNoWarp(pp);
|
||||
DoPlayerBeginRun(pp);
|
||||
|
@ -4656,7 +4634,7 @@ int DoPlayerTestPlaxDeath(PLAYERp pp)
|
|||
void DoPlayerCurrent(PLAYERp pp)
|
||||
{
|
||||
int xvect, yvect;
|
||||
auto sectu = pp->cursector();
|
||||
auto sectu = pp->cursector;
|
||||
int push_ret;
|
||||
|
||||
if (!sectu)
|
||||
|
@ -4665,7 +4643,7 @@ void DoPlayerCurrent(PLAYERp pp)
|
|||
xvect = sectu->speed * synctics * bcos(sectu->ang) >> 4;
|
||||
yvect = sectu->speed * synctics * bsin(sectu->ang) >> 4;
|
||||
|
||||
push_ret = pushmove(&pp->pos, &pp->cursectnum, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
push_ret = pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!TEST(pp->Flags, PF_DEAD))
|
||||
|
@ -4681,13 +4659,10 @@ void DoPlayerCurrent(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
Collision coll;
|
||||
#pragma message(__FILE__ "remove workaround");
|
||||
sectortype* cursect = pp->cursector();
|
||||
clipmove(pp->pos, &cursect, xvect, yvect, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
pp->setcursector(cursect);
|
||||
clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
PlayerCheckValidMove(pp);
|
||||
pushmove(&pp->pos, &pp->cursectnum, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
{
|
||||
if (!TEST(pp->Flags, PF_DEAD))
|
||||
|
@ -4778,7 +4753,7 @@ void DoPlayerWade(PLAYERp pp)
|
|||
{
|
||||
if (pp->KeyPressBits & SB_OPEN)
|
||||
{
|
||||
if (TEST(pp->cursector()->extra, SECTFX_OPERATIONAL))
|
||||
if (TEST(pp->cursector->extra, SECTFX_OPERATIONAL))
|
||||
{
|
||||
pp->KeyPressBits &= ~SB_OPEN;
|
||||
DoPlayerBeginOperate(pp);
|
||||
|
@ -4997,7 +4972,7 @@ void DoPlayerBeginOperate(PLAYERp pp)
|
|||
int cz, fz;
|
||||
int i;
|
||||
|
||||
sop = PlayerOnObject(pp->cursector());
|
||||
sop = PlayerOnObject(pp->cursector);
|
||||
|
||||
// if someone already controlling it
|
||||
if (sop->controller)
|
||||
|
@ -5035,8 +5010,8 @@ void DoPlayerBeginOperate(PLAYERp pp)
|
|||
pp->angle.oang = pp->angle.ang = buildang(sop->ang);
|
||||
pp->posx = sop->xmid;
|
||||
pp->posy = sop->ymid;
|
||||
updatesector(pp->posx, pp->posy, &pp->cursectnum);
|
||||
getzsofslopeptr(pp->cursector(), pp->posx, pp->posy, &cz, &fz);
|
||||
updatesector(pp->posx, pp->posy, &pp->cursector);
|
||||
getzsofslopeptr(pp->cursector, pp->posx, pp->posy, &cz, &fz);
|
||||
pp->posz = fz - PLAYER_HEIGHT;
|
||||
|
||||
RESET(pp->Flags, PF_CRAWLING|PF_JUMPING|PF_FALLING|PF_LOCK_CRAWL);
|
||||
|
@ -5115,13 +5090,13 @@ void DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop)
|
|||
}
|
||||
}
|
||||
|
||||
auto save_sect = pp->cursector();
|
||||
auto save_sect = pp->cursector;
|
||||
|
||||
pp->angle.oang = pp->angle.ang = buildang(sop->ang);
|
||||
pp->posx = sop->xmid;
|
||||
pp->posy = sop->ymid;
|
||||
updatesector(pp->posx, pp->posy, &pp->cursectnum);
|
||||
getzsofslopeptr(pp->cursector(), pp->posx, pp->posy, &cz, &fz);
|
||||
updatesector(pp->posx, pp->posy, &pp->cursector);
|
||||
getzsofslopeptr(pp->cursector, pp->posx, pp->posy, &cz, &fz);
|
||||
pp->posz = fz - PLAYER_HEIGHT;
|
||||
|
||||
RESET(pp->Flags, PF_CRAWLING|PF_JUMPING|PF_FALLING|PF_LOCK_CRAWL);
|
||||
|
@ -5171,8 +5146,8 @@ void DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop)
|
|||
|
||||
void PlayerToRemote(PLAYERp pp)
|
||||
{
|
||||
pp->remote.cursectp = pp->cursector();
|
||||
pp->remote.lastcursectp = pp->lastcursector();
|
||||
pp->remote.cursectp = pp->cursector;
|
||||
pp->remote.lastcursectp = pp->lastcursector;
|
||||
|
||||
pp->remote.posx = pp->posx;
|
||||
pp->remote.posy = pp->posy;
|
||||
|
@ -5189,7 +5164,7 @@ void PlayerToRemote(PLAYERp pp)
|
|||
void RemoteToPlayer(PLAYERp pp)
|
||||
{
|
||||
pp->setcursector(pp->remote.cursectp);
|
||||
pp->lastcursectnum = sectnum(pp->remote.lastcursectp);
|
||||
pp->lastcursector = pp->remote.lastcursectp;
|
||||
|
||||
pp->posx = pp->remote.posx;
|
||||
pp->posy = pp->remote.posy;
|
||||
|
@ -5206,7 +5181,7 @@ void RemoteToPlayer(PLAYERp pp)
|
|||
void PlayerRemoteReset(PLAYERp pp, sectortype* sect)
|
||||
{
|
||||
pp->setcursector(sect);
|
||||
pp->backupcursector();
|
||||
pp->lastcursector = pp->cursector;
|
||||
|
||||
auto rsp = &pp->remoteActor->s();
|
||||
pp->posx = rsp->x;
|
||||
|
@ -5278,7 +5253,7 @@ void DoPlayerOperateTurret(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
|
||||
auto save_sect = pp->cursector();
|
||||
auto save_sect = pp->cursector;
|
||||
|
||||
if (pp->sop_remote)
|
||||
RemoteToPlayer(pp);
|
||||
|
@ -5316,7 +5291,7 @@ void DoPlayerOperateVehicle(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
|
||||
auto save_sect = pp->cursector();
|
||||
auto save_sect = pp->cursector;
|
||||
|
||||
if (pp->sop_remote)
|
||||
RemoteToPlayer(pp);
|
||||
|
@ -5840,7 +5815,7 @@ void DoPlayerDeathFollowKiller(PLAYERp pp)
|
|||
{
|
||||
SPRITEp kp = &pp->KillerActor->s();
|
||||
|
||||
if (FAFcansee(kp->x, kp->y, SPRITEp_TOS(kp), kp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector()))
|
||||
if (FAFcansee(kp->x, kp->y, SPRITEp_TOS(kp), kp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector))
|
||||
{
|
||||
pp->angle.addadjustment(getincanglebam(pp->angle.ang, bvectangbam(kp->x - pp->posx, kp->y - pp->posy)) >> 4);
|
||||
}
|
||||
|
@ -5932,7 +5907,7 @@ void DoPlayerDeathCheckKeys(PLAYERp pp)
|
|||
|
||||
void DoPlayerHeadDebris(PLAYERp pp)
|
||||
{
|
||||
SECTORp sectp = pp->cursector();
|
||||
SECTORp sectp = pp->cursector;
|
||||
|
||||
if (TEST(sectp->extra, SECTFX_SINK))
|
||||
{
|
||||
|
@ -6058,18 +6033,18 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
|
|||
pp->setcursector(sp->sector());
|
||||
|
||||
// try to stay in valid area - death sometimes throws you out of the map
|
||||
int sectnum = pp->cursectnum;
|
||||
updatesector(pp->posx, pp->posy, §num);
|
||||
if (sectnum < 0)
|
||||
auto sect = pp->cursector;
|
||||
updatesector(pp->posx, pp->posy, §);
|
||||
if (sect == nullptr)
|
||||
{
|
||||
pp->cursectnum = pp->lv_sectnum;
|
||||
ChangeActorSect(pp->Actor(), pp->lv_sectnum);
|
||||
pp->cursector = pp->lv_sector;
|
||||
ChangeActorSect(pp->Actor(), pp->lv_sector);
|
||||
pp->posx = sp->x = pp->lv_x;
|
||||
pp->posy = sp->y = pp->lv_y;
|
||||
}
|
||||
else
|
||||
{
|
||||
pp->lv_sectnum = sectnum;
|
||||
pp->lv_sector = sect;
|
||||
pp->lv_x = pp->posx;
|
||||
pp->lv_y = pp->posy;
|
||||
}
|
||||
|
@ -6324,7 +6299,7 @@ void DoPlayerRun(PLAYERp pp)
|
|||
{
|
||||
USERp u = pp->Actor()->u();
|
||||
|
||||
if (SectorIsUnderwaterArea(pp->cursector()))
|
||||
if (SectorIsUnderwaterArea(pp->cursector))
|
||||
{
|
||||
DoPlayerBeginDiveNoWarp(pp);
|
||||
return;
|
||||
|
@ -6380,13 +6355,13 @@ void DoPlayerRun(PLAYERp pp)
|
|||
{
|
||||
if ((pp->KeyPressBits & SB_OPEN) && pp->insector())
|
||||
{
|
||||
if (TEST(pp->cursector()->extra, SECTFX_OPERATIONAL))
|
||||
if (TEST(pp->cursector->extra, SECTFX_OPERATIONAL))
|
||||
{
|
||||
pp->KeyPressBits &= ~SB_OPEN;
|
||||
DoPlayerBeginOperate(pp);
|
||||
return;
|
||||
}
|
||||
else if (TEST(pp->cursector()->extra, SECTFX_TRIGGER))
|
||||
else if (TEST(pp->cursector->extra, SECTFX_TRIGGER))
|
||||
{
|
||||
auto sActor = FindNearSprite(pp->Actor(), STAT_TRIGGER);
|
||||
if (sActor && SP_TAG5(&sActor->s()) == TRIGGER_TYPE_REMOTE_SO)
|
||||
|
@ -6449,7 +6424,7 @@ void DoPlayerRun(PLAYERp pp)
|
|||
return;
|
||||
}
|
||||
|
||||
if (TEST(pp->cursector()->extra, SECTFX_DYNAMIC_AREA))
|
||||
if (TEST(pp->cursector->extra, SECTFX_DYNAMIC_AREA))
|
||||
{
|
||||
pp->posz = pp->loz - PLAYER_HEIGHT;
|
||||
}
|
||||
|
@ -6873,9 +6848,9 @@ void InitAllPlayers(void)
|
|||
pp->posz = pp->oposz = pfirst->posz;
|
||||
pp->angle.ang = pp->angle.oang = pfirst->angle.ang;
|
||||
pp->horizon.horiz = pp->horizon.ohoriz = pfirst->horizon.horiz;
|
||||
pp->cursectnum = pfirst->cursectnum;
|
||||
pp->cursector = pfirst->cursector;
|
||||
// set like this so that player can trigger something on start of the level
|
||||
pp->lastcursectnum = pfirst->cursectnum+1;
|
||||
pp->lastcursector = pfirst->cursector+1;
|
||||
|
||||
//pp->MaxHealth = 100;
|
||||
|
||||
|
@ -7031,7 +7006,7 @@ void PlayerSpawnPosition(PLAYERp pp)
|
|||
pp->angle.ang = pp->angle.oang = buildang(sp->ang);
|
||||
pp->setcursector(sp->sector());
|
||||
|
||||
getzsofslopeptr(pp->cursector(), pp->posx, pp->posy, &cz, &fz);
|
||||
getzsofslopeptr(pp->cursector, pp->posx, pp->posy, &cz, &fz);
|
||||
// if too close to the floor - stand up
|
||||
if (pp->posz > fz - PLAYER_HEIGHT)
|
||||
{
|
||||
|
@ -7088,7 +7063,7 @@ void InitMultiPlayerInfo(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
auto start0 = SpawnActor(MultiStatList[stat], ST1, nullptr, pp->cursector(), pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
|
||||
auto start0 = SpawnActor(MultiStatList[stat], ST1, nullptr, pp->cursector, pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
|
||||
start0->clearUser();
|
||||
start0->s().picnum = ST1;
|
||||
}
|
||||
|
@ -7130,7 +7105,7 @@ int DoFootPrints(DSWActor* actor)
|
|||
if (!u->PlayerP->insector())
|
||||
return 0;
|
||||
|
||||
if (FAF_ConnectArea(u->PlayerP->cursector()))
|
||||
if (FAF_ConnectArea(u->PlayerP->cursector))
|
||||
return 0;
|
||||
|
||||
if (u->PlayerP->NumFootPrints > 0)
|
||||
|
@ -7272,8 +7247,8 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, drive_avel)
|
|||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, view_outside_dang)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, circle_camera_ang)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, camera_check_time_delay)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, cursectnum)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, lastcursectnum)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, cursector)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, lastcursector)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, turn180_target)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, hvel)
|
||||
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, tilt)
|
||||
|
|
|
@ -259,7 +259,7 @@ void SpawnQuake(sectortype* sect, int x, int y, int z,
|
|||
bool
|
||||
SetQuake(PLAYERp pp, short tics, short amt)
|
||||
{
|
||||
SpawnQuake(pp->cursector(), pp->posx, pp->posy, pp->posz, tics, amt, 30000);
|
||||
SpawnQuake(pp->cursector, pp->posx, pp->posy, pp->posz, tics, amt, 30000);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ SetGunQuake(DSWActor* actor)
|
|||
int
|
||||
SetPlayerQuake(PLAYERp pp)
|
||||
{
|
||||
SpawnQuake(pp->cursector(), pp->posx, pp->posy, pp->posz, 40, 8, 40000);
|
||||
SpawnQuake(pp->cursector, pp->posx, pp->posy, pp->posz, 40, 8, 40000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -437,7 +437,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
|
|||
arc("x", w.posx)
|
||||
("y", w.posy)
|
||||
("z", w.posz)
|
||||
("lv_sectnum", w.lv_sectnum)
|
||||
("lv_sectnum", w.lv_sector)
|
||||
("lv_x", w.lv_x)
|
||||
("lv_y", w.lv_y)
|
||||
("lv_z", w.lv_z)
|
||||
|
@ -476,8 +476,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
|
|||
("view_outside_dang", w.view_outside_dang)
|
||||
("circle_camera_ang", w.circle_camera_ang)
|
||||
("camera_check_time_delay", w.camera_check_time_delay)
|
||||
("cursectnum", w.cursectnum)
|
||||
("lastcursectnum", w.lastcursectnum)
|
||||
("cursectnum", w.cursector)
|
||||
("lastcursectnum", w.lastcursector)
|
||||
("turn180_target", w.turn180_target)
|
||||
("hvel", w.hvel)
|
||||
("tilt", w.tilt)
|
||||
|
|
|
@ -611,7 +611,7 @@ void SectorMidPoint(sectortype* sectp, int *xmid, int *ymid, int *zmid)
|
|||
void DoSpringBoard(PLAYERp pp/*, short sectnum*/)
|
||||
{
|
||||
|
||||
pp->jump_speed = -pp->cursector()->hitag;
|
||||
pp->jump_speed = -pp->cursector->hitag;
|
||||
DoPlayerBeginForceJump(pp);
|
||||
return;
|
||||
}
|
||||
|
@ -1453,7 +1453,7 @@ int OperateSprite(DSWActor* actor, short player_is_operating)
|
|||
{
|
||||
pp = GlobPlayerP;
|
||||
|
||||
if (!FAFcansee(pp->posx, pp->posy, pp->posz, pp->cursector(), sp->x, sp->y, sp->z - DIV2(SPRITEp_SIZE_Z(sp)), sp->sector()))
|
||||
if (!FAFcansee(pp->posx, pp->posy, pp->posz, pp->cursector, sp->x, sp->y, sp->z - DIV2(SPRITEp_SIZE_Z(sp)), sp->sector()))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1843,10 +1843,10 @@ void OperateTripTrigger(PLAYERp pp)
|
|||
if (!pp->insector())
|
||||
return;
|
||||
|
||||
SECTORp sectp = pp->cursector();
|
||||
SECTORp sectp = pp->cursector;
|
||||
|
||||
// old method
|
||||
switch (pp->cursector()->lotag)
|
||||
switch (pp->cursector->lotag)
|
||||
{
|
||||
// same tag for sector as for switch
|
||||
case TAG_LEVEL_EXIT_SWITCH:
|
||||
|
@ -1864,7 +1864,7 @@ void OperateTripTrigger(PLAYERp pp)
|
|||
if (pp == Player+myconnectindex)
|
||||
PlayerSound(DIGI_ANCIENTSECRET, v3df_dontpan|v3df_doppler|v3df_follow,pp);
|
||||
|
||||
SECRET_Trigger(pp->cursectnum);
|
||||
SECRET_Trigger(sectnum(pp->cursector));
|
||||
|
||||
PutStringInfo(pp, GStrings("TXTS_SECRET"));
|
||||
// always give to the first player
|
||||
|
@ -1939,31 +1939,31 @@ void OperateTripTrigger(PLAYERp pp)
|
|||
case TAG_TRIGGER_MISSILE_TRAP:
|
||||
{
|
||||
// reset traps so they fire immediately
|
||||
DoTrapReset(pp->cursector()->hitag);
|
||||
DoTrapReset(pp->cursector->hitag);
|
||||
break;
|
||||
}
|
||||
|
||||
case TAG_TRIGGER_EXPLODING_SECTOR:
|
||||
{
|
||||
DoMatchEverything(nullptr, pp->cursector()->hitag, -1);
|
||||
DoMatchEverything(nullptr, pp->cursector->hitag, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
case TAG_SPAWN_ACTOR_TRIGGER:
|
||||
{
|
||||
DoMatchEverything(nullptr, pp->cursector()->hitag, -1);
|
||||
DoMatchEverything(nullptr, pp->cursector->hitag, -1);
|
||||
|
||||
pp->cursector()->hitag = 0;
|
||||
pp->cursector()->lotag = 0;
|
||||
pp->cursector->hitag = 0;
|
||||
pp->cursector->lotag = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
case TAG_SO_EVENT_TRIGGER:
|
||||
{
|
||||
DoMatchEverything(nullptr, pp->cursector()->hitag, -1);
|
||||
DoMatchEverything(nullptr, pp->cursector->hitag, -1);
|
||||
|
||||
pp->cursector()->hitag = 0;
|
||||
pp->cursector()->lotag = 0;
|
||||
pp->cursector->hitag = 0;
|
||||
pp->cursector->lotag = 0;
|
||||
|
||||
PlaySound(DIGI_REGULARSWITCH, pp, v3df_none);
|
||||
break;
|
||||
|
@ -1979,11 +1979,11 @@ void OperateContinuousTrigger(PLAYERp pp)
|
|||
if (!pp->insector())
|
||||
return;
|
||||
|
||||
switch (pp->cursector()->lotag)
|
||||
switch (pp->cursector->lotag)
|
||||
{
|
||||
case TAG_TRIGGER_MISSILE_TRAP:
|
||||
{
|
||||
DoTrapMatch(pp->cursector()->hitag);
|
||||
DoTrapMatch(pp->cursector->hitag);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1993,7 +1993,7 @@ void OperateContinuousTrigger(PLAYERp pp)
|
|||
|
||||
short PlayerTakeSectorDamage(PLAYERp pp)
|
||||
{
|
||||
auto sectu = pp->cursector();
|
||||
auto sectu = pp->cursector;
|
||||
USERp u = pp->Actor()->u();
|
||||
|
||||
// the calling routine must make sure sectu exists
|
||||
|
@ -2017,14 +2017,14 @@ bool NearThings(PLAYERp pp)
|
|||
|
||||
|
||||
// Check player's current sector for triggered sound
|
||||
if (pp->cursector()->hitag == PLAYER_SOUNDEVENT_TAG)
|
||||
if (pp->cursector->hitag == PLAYER_SOUNDEVENT_TAG)
|
||||
{
|
||||
if (pp == Player+myconnectindex)
|
||||
PlayerSound(pp->cursector()->lotag, v3df_follow|v3df_dontpan,pp);
|
||||
PlayerSound(pp->cursector->lotag, v3df_follow|v3df_dontpan,pp);
|
||||
return false;
|
||||
}
|
||||
|
||||
neartag(pp->posx, pp->posy, pp->posz, pp->cursectnum, pp->angle.ang.asbuild(),
|
||||
neartag(pp->posx, pp->posy, pp->posz, sectnum(pp->cursector), pp->angle.ang.asbuild(),
|
||||
&neartagsect, &neartagwall, &neartagsprite,
|
||||
&neartaghitdist, 1024L, NTAG_SEARCH_LO_HI, nullptr);
|
||||
|
||||
|
@ -2061,7 +2061,7 @@ bool NearThings(PLAYERp pp)
|
|||
HitInfo hit;
|
||||
short dang = pp->angle.ang.asbuild();
|
||||
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz - Z(30), pp->cursector(), // Start position
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz - Z(30), pp->cursector, // Start position
|
||||
bcos(dang), // X vector of 3D ang
|
||||
bsin(dang), // Y vector of 3D ang
|
||||
0, // Z vector of 3D ang
|
||||
|
@ -2112,7 +2112,7 @@ void NearTagList(NEAR_TAG_INFOp ntip, PLAYERp pp, int z, int dist, int type, int
|
|||
int neartaghitdist;
|
||||
|
||||
|
||||
neartag(pp->posx, pp->posy, z, pp->cursectnum, pp->angle.ang.asbuild(),
|
||||
neartag(pp->posx, pp->posy, z, sectnum(pp->cursector), pp->angle.ang.asbuild(),
|
||||
&neartagsector, &neartagwall, &neartagsprite,
|
||||
&neartaghitdist, dist, type, nullptr);
|
||||
|
||||
|
@ -2354,20 +2354,20 @@ void PlayerOperateEnv(PLAYERp pp)
|
|||
// Trigger operations
|
||||
//
|
||||
|
||||
switch (pp->cursector()->lotag)
|
||||
switch (pp->cursector->lotag)
|
||||
{
|
||||
case TAG_VATOR:
|
||||
DoVatorOperate(pp, pp->cursector());
|
||||
DoSpikeOperate(pp->cursector());
|
||||
DoRotatorOperate(pp, pp->cursector());
|
||||
DoSlidorOperate(pp, pp->cursector());
|
||||
DoVatorOperate(pp, pp->cursector);
|
||||
DoSpikeOperate(pp->cursector);
|
||||
DoRotatorOperate(pp, pp->cursector);
|
||||
DoSlidorOperate(pp, pp->cursector);
|
||||
break;
|
||||
case TAG_SPRING_BOARD:
|
||||
DoSpringBoard(pp);
|
||||
pp->KeyPressBits &= ~SB_OPEN;
|
||||
break;
|
||||
case TAG_DOOR_ROTATE:
|
||||
if (OperateSector(pp->cursector(), true))
|
||||
if (OperateSector(pp->cursector, true))
|
||||
pp->KeyPressBits &= ~SB_OPEN;
|
||||
break;
|
||||
}
|
||||
|
@ -2385,7 +2385,7 @@ void PlayerOperateEnv(PLAYERp pp)
|
|||
//
|
||||
// ////////////////////////////
|
||||
|
||||
SECTORp sectp = pp->cursector();
|
||||
SECTORp sectp = pp->cursector;
|
||||
if (pp->insector() && sectp->hasU() && sectp->damage)
|
||||
{
|
||||
if (TEST(sectp->flags, SECTFU_DAMAGE_ABOVE_SECTOR))
|
||||
|
@ -2413,11 +2413,11 @@ void PlayerOperateEnv(PLAYERp pp)
|
|||
OperateContinuousTrigger(pp);
|
||||
|
||||
// just changed sectors
|
||||
if (pp->lastcursector() != pp->cursector())
|
||||
if (pp->lastcursector != pp->cursector)
|
||||
{
|
||||
OperateTripTrigger(pp);
|
||||
|
||||
if (pp->insector() && TEST(pp->cursector()->extra, SECTFX_WARP_SECTOR))
|
||||
if (pp->insector() && TEST(pp->cursector->extra, SECTFX_WARP_SECTOR))
|
||||
{
|
||||
if (!TEST(pp->Flags2, PF2_TELEPORTED))
|
||||
{
|
||||
|
|
|
@ -382,7 +382,7 @@ static void UpdateAmbients()
|
|||
if (sdist < 255 && amb->vocIndex == DIGI_WHIPME)
|
||||
{
|
||||
PLAYERp pp = Player + screenpeek;
|
||||
if (!FAFcansee(sp->pos.x, sp->pos.y, sp->pos.z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector()))
|
||||
if (!FAFcansee(sp->pos.x, sp->pos.y, sp->pos.z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector))
|
||||
{
|
||||
sdist = 255;
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
|
|||
// Can the ambient sound see the player? If not, tone it down some.
|
||||
if ((chanflags & CHANF_LOOP))
|
||||
{
|
||||
if (!FAFcansee(vpos->x, vpos->y, vpos->z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector()))
|
||||
if (!FAFcansee(vpos->x, vpos->y, vpos->z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector))
|
||||
{
|
||||
auto distvec = npos - campos;
|
||||
npos = campos + distvec * 1.75f; // Play more quietly
|
||||
|
|
|
@ -1540,7 +1540,7 @@ void PreMapCombineFloors(void)
|
|||
TRAVERSE_CONNECT(pnum)
|
||||
{
|
||||
PLAYERp pp = &Player[pnum];
|
||||
auto dasect = pp->cursector();
|
||||
auto dasect = pp->cursector;
|
||||
search.Rewind();
|
||||
while (auto itsect = search.GetNext())
|
||||
{
|
||||
|
@ -5250,7 +5250,7 @@ int DoGet(DSWActor* actor)
|
|||
cstat_bak = sp->cstat;
|
||||
SET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
can_see = FAFcansee(sp->x, sp->y, sp->z, sp->sector(),
|
||||
pp->posx, pp->posy, pp->posz, pp->cursector());
|
||||
pp->posx, pp->posy, pp->posz, pp->cursector);
|
||||
sp->cstat = cstat_bak;
|
||||
|
||||
if (!can_see)
|
||||
|
|
|
@ -838,7 +838,7 @@ void BossHealthMeter(void)
|
|||
sp = &BossSpriteNum[i]->s();
|
||||
u = BossSpriteNum[i]->u();
|
||||
|
||||
if (cansee(sp->x, sp->y, SPRITEp_TOS(sp), sp->sector(), pp->posx, pp->posy, pp->posz - Z(40), pp->cursector()))
|
||||
if (cansee(sp->x, sp->y, SPRITEp_TOS(sp), sp->sector(), pp->posx, pp->posy, pp->posz - Z(40), pp->cursector))
|
||||
{
|
||||
if (i == 0 && !bosswasseen[0])
|
||||
{
|
||||
|
|
|
@ -1851,7 +1851,7 @@ PlayerPart:
|
|||
// prevents you from falling into map HOLEs created by moving
|
||||
// Sectors and sprites around.
|
||||
//if (sop->xmid < MAXSO)
|
||||
updatesector(pp->posx, pp->posy, &pp->cursectnum);
|
||||
updatesector(pp->posx, pp->posy, &pp->cursector);
|
||||
|
||||
// in case you are in a whirlpool
|
||||
// move perfectly with the ride in the z direction
|
||||
|
|
|
@ -117,7 +117,7 @@ void VisViewChange(PLAYERp pp, int *vis)
|
|||
}
|
||||
|
||||
// save off the brightest vis that you can see
|
||||
if (FAFcansee(pp->posx, pp->posy, pp->posz, pp->cursector(), x, y, z, sectp))
|
||||
if (FAFcansee(pp->posx, pp->posy, pp->posz, pp->cursector, x, y, z, sectp))
|
||||
{
|
||||
if (VIS_VisCur(sp) < BrightestVis)
|
||||
BrightestVis = VIS_VisCur(sp);
|
||||
|
|
|
@ -2760,9 +2760,9 @@ int DoLavaErupt(DSWActor* actor)
|
|||
TRAVERSE_CONNECT(pnum)
|
||||
{
|
||||
pp = Player + pnum;
|
||||
if (pp->insector() && TEST(pp->cursector()->extra, SECTFX_TRIGGER))
|
||||
if (pp->insector() && TEST(pp->cursector->extra, SECTFX_TRIGGER))
|
||||
{
|
||||
SWSectIterator it(pp->cursector());
|
||||
SWSectIterator it(pp->cursector);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
tsp = &itActor->s();
|
||||
|
@ -11835,7 +11835,7 @@ void InitSpellRing(PLAYERp pp)
|
|||
|
||||
for (missiles = 0, ang = ang_start; missiles < max_missiles; ang += ang_diff, missiles++)
|
||||
{
|
||||
auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, FIREBALL1, s_Ring, pp->cursector(), pp->posx, pp->posy, pp->posz, ang, 0);
|
||||
auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, FIREBALL1, s_Ring, pp->cursector, pp->posx, pp->posy, pp->posz, ang, 0);
|
||||
|
||||
sp = &actorNew->s();
|
||||
|
||||
|
@ -12216,7 +12216,7 @@ void InitSpellNapalm(PLAYERp pp)
|
|||
|
||||
for (i = 0; i < SIZ(mp); i++)
|
||||
{
|
||||
auto actor = SpawnActor(STAT_MISSILE, FIREBALL1, s_Napalm, pp->cursector(),
|
||||
auto actor = SpawnActor(STAT_MISSILE, FIREBALL1, s_Napalm, pp->cursector,
|
||||
pp->posx, pp->posy, pp->posz + Z(12), pp->angle.ang.asbuild(), NAPALM_VELOCITY*2);
|
||||
|
||||
sp = &actor->s();
|
||||
|
@ -12368,7 +12368,7 @@ int InitSpellMirv(PLAYERp pp)
|
|||
if (!pp->insector())
|
||||
return 0;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Mirv, pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Mirv, pp->cursector,
|
||||
pp->posx, pp->posy, pp->posz + Z(12), pp->angle.ang.asbuild(), MIRV_VELOCITY);
|
||||
|
||||
sp = &actorNew->s();
|
||||
|
@ -12534,7 +12534,7 @@ int InitSwordAttack(PLAYERp pp)
|
|||
daang = pp->angle.ang.asbuild();
|
||||
daz = -MulScale(pp->horizon.horiz.asq16(), 2000, 16) + (RandomRange(24000) - 12000);
|
||||
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz, pp->cursector(), // Start position
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz, pp->cursector, // Start position
|
||||
bcos(daang), // X vector of 3D ang
|
||||
bsin(daang), // Y vector of 3D ang
|
||||
daz, // Z vector of 3D ang
|
||||
|
@ -12724,7 +12724,7 @@ int InitFistAttack(PLAYERp pp)
|
|||
daang = pp->angle.ang.asbuild();
|
||||
daz = -MulScale(pp->horizon.horiz.asq16(), 2000, 16) + (RandomRange(24000) - 12000);
|
||||
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz, pp->cursector(), // Start position
|
||||
FAFhitscan(pp->posx, pp->posy, pp->posz, pp->cursector, // Start position
|
||||
bcos(daang), // X vector of 3D ang
|
||||
bsin(daang), // Y vector of 3D ang
|
||||
daz, // Z vector of 3D ang
|
||||
|
@ -13344,7 +13344,7 @@ int InitStar(PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector(), nx, ny, nz, pp->angle.ang.asbuild(), STAR_VELOCITY);
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, pp->angle.ang.asbuild(), STAR_VELOCITY);
|
||||
wp = &actorNew->s();
|
||||
wu = actorNew->u();
|
||||
|
||||
|
@ -13389,7 +13389,7 @@ int InitStar(PLAYERp pp)
|
|||
|
||||
for (i = 0; i < (int)SIZ(dang); i++)
|
||||
{
|
||||
auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector(), nx, ny, nz, NORM_ANGLE(wp->ang + dang[i]), wp->xvel);
|
||||
auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, NORM_ANGLE(wp->ang + dang[i]), wp->xvel);
|
||||
np = &actorNew2->s();
|
||||
nu = actorNew2->u();
|
||||
|
||||
|
@ -13453,7 +13453,7 @@ void InitHeartAttack(PLAYERp pp)
|
|||
if (!pp->insector())
|
||||
return;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, BLOOD_WORM, s_BloodWorm, pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE_SKIP4, BLOOD_WORM, s_BloodWorm, pp->cursector,
|
||||
pp->posx, pp->posy, pp->posz + Z(12), pp->angle.ang.asbuild(), BLOOD_WORM_VELOCITY*2);
|
||||
|
||||
sp = &actorNew->s();
|
||||
|
@ -13628,7 +13628,7 @@ int InitShotgun(PLAYERp pp)
|
|||
xvect = bcos(ndaang);
|
||||
yvect = bsin(ndaang);
|
||||
zvect = ndaz;
|
||||
FAFhitscan(nx, ny, nz, pp->cursector(), // Start position
|
||||
FAFhitscan(nx, ny, nz, pp->cursector, // Start position
|
||||
xvect, yvect, zvect,
|
||||
hit, CLIPMASK_MISSILE);
|
||||
|
||||
|
@ -13765,7 +13765,7 @@ int InitLaser(PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), 300);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -13874,7 +13874,7 @@ int InitRail(PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), 1200);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -14054,7 +14054,7 @@ int InitRocket(PLAYERp pp)
|
|||
// Inserting and setting up variables
|
||||
|
||||
nz = pp->posz + pp->bob_z + Z(8);
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), ROCKET_VELOCITY);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -14168,7 +14168,7 @@ int InitBunnyRocket(PLAYERp pp)
|
|||
|
||||
//nz = pp->posz + pp->bob_z + Z(12);
|
||||
nz = pp->posz + pp->bob_z + Z(8);
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R4, &s_BunnyRocket[0][0], pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R4, &s_BunnyRocket[0][0], pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), ROCKET_VELOCITY);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -14276,7 +14276,7 @@ int InitNuke(PLAYERp pp)
|
|||
// Inserting and setting up variables
|
||||
|
||||
nz = pp->posz + pp->bob_z + Z(8);
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), 700);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -14474,7 +14474,7 @@ int InitMicro(PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], pp->cursector,
|
||||
nx, ny, nz, ang, 1200);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -15819,7 +15819,7 @@ int InitTracerUzi(PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, 0, s_Tracer, pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, 0, s_Tracer, pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), TRACER_VELOCITY);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -16188,7 +16188,7 @@ int InitUzi(PLAYERp pp)
|
|||
xvect = bcos(daang);
|
||||
yvect = bsin(daang);
|
||||
zvect = daz;
|
||||
FAFhitscan(pp->posx, pp->posy, nz, pp->cursector(), // Start position
|
||||
FAFhitscan(pp->posx, pp->posy, nz, pp->cursector, // Start position
|
||||
xvect,yvect,zvect,
|
||||
hit, CLIPMASK_MISSILE);
|
||||
|
||||
|
@ -16605,7 +16605,7 @@ int InitTurretRail(DSWActor* actor, PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector,
|
||||
nx, ny, nz, sp->ang, 1200);
|
||||
|
||||
wu = actorNew->u();
|
||||
|
@ -16661,7 +16661,7 @@ int InitTurretLaser(DSWActor* actor, PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector,
|
||||
nx, ny, nz, sp->ang, 300);
|
||||
|
||||
wu = actorNew->u();
|
||||
|
@ -17415,7 +17415,7 @@ int InitGrenade(PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, GRENADE, &s_Grenade[0][0], pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, GRENADE, &s_Grenade[0][0], pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), GRENADE_VELOCITY);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -17573,7 +17573,7 @@ int InitMine(PLAYERp pp)
|
|||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, pp->cursector(),
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, pp->cursector,
|
||||
nx, ny, nz, pp->angle.ang.asbuild(), MINE_VELOCITY);
|
||||
|
||||
wp = &actorNew->s();
|
||||
|
@ -17718,7 +17718,7 @@ int InitFireball(PLAYERp pp)
|
|||
|
||||
nz = pp->posz + pp->bob_z + Z(15);
|
||||
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Fireball, pp->cursector(), nx, ny, nz, pp->angle.ang.asbuild(), FIREBALL_VELOCITY);
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Fireball, pp->cursector, nx, ny, nz, pp->angle.ang.asbuild(), FIREBALL_VELOCITY);
|
||||
wp = &actorNew->s();
|
||||
wu = actorNew->u();
|
||||
|
||||
|
@ -18756,9 +18756,9 @@ int QueueFootPrint(DSWActor* actor)
|
|||
Found = true;
|
||||
|
||||
// Stupid masked floor stuff! Damn your weirdness!
|
||||
if (TEST(u->PlayerP->cursector()->ceilingstat, CEILING_STAT_PLAX))
|
||||
if (TEST(u->PlayerP->cursector->ceilingstat, CEILING_STAT_PLAX))
|
||||
Found = true;
|
||||
if (TEST(u->PlayerP->cursector()->floorstat, CEILING_STAT_PLAX))
|
||||
if (TEST(u->PlayerP->cursector->floorstat, CEILING_STAT_PLAX))
|
||||
Found = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -781,10 +781,10 @@ void SpawnZombie(PLAYERp pp, DSWActor* weaponActor)
|
|||
if (ownerActor == nullptr)
|
||||
return;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursector(), pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursector, pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0);
|
||||
np = &actorNew->s();
|
||||
nu = actorNew->u();
|
||||
np->setsector(pp->cursector());
|
||||
np->setsector(pp->cursector);
|
||||
SetOwner(actorNew, ownerActor);
|
||||
np->pal = nu->spal = ownerActor->u()->spal;
|
||||
np->ang = RANDOM_P2(2048);
|
||||
|
|
Loading…
Reference in a new issue