- made one_parallax_sectnum a pointer

This commit is contained in:
Christoph Oelckers 2021-11-18 00:08:52 +01:00
parent bc199d00c7
commit 0f2f46ec35
5 changed files with 11 additions and 22 deletions

View file

@ -3815,10 +3815,10 @@ void handle_se13(DDukeActor* actor)
sc->floorshade = s->shade;
if (ps[0].one_parallax_sectnum >= 0)
if (ps[0].one_parallax_sectnum != nullptr)
{
sc->ceilingpicnum = ps[0].one_parallax_sector()->ceilingpicnum;
sc->ceilingshade = ps[0].one_parallax_sector()->ceilingshade;
sc->ceilingpicnum = ps[0].one_parallax_sectnum->ceilingpicnum;
sc->ceilingshade = ps[0].one_parallax_sectnum->ceilingshade;
}
}
}

View file

@ -601,11 +601,6 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
else SetGameVarID(lVar2, ps[iPlayer].i, sActor, sPlayer);
break;
case PLAYER_ONE_PARALLAX_SECTNUM:
if (bSet) ps[iPlayer].one_parallax_sectnum = lValue;
else SetGameVarID(lVar2, ps[iPlayer].one_parallax_sectnum, sActor, sPlayer);
break;
case PLAYER_OVER_SHOULDER_ON:
if (bSet) ps[iPlayer].over_shoulder_on = lValue;
else SetGameVarID(lVar2, ps[iPlayer].over_shoulder_on, sActor, sPlayer);

View file

@ -408,7 +408,7 @@ void resetprestat(int snum,int g)
p->holster_weapon = 0;
p->last_pissed_time = 0;
p->one_parallax_sectnum = -1;
p->one_parallax_sectnum = nullptr;
p->visibility = ud.const_visibility;
screenpeek = myconnectindex;
@ -652,8 +652,6 @@ void lava_cleararrays();
void prelevel_common(int g)
{
int i;
auto p = &ps[screenpeek];
p->sea_sick_stat = 0;
ufospawnsminion = 0;
@ -691,9 +689,9 @@ void prelevel_common(int g)
memset(ambienthitag, -1, sizeof(ambienthitag));
memset(ambientlotag, -1, sizeof(ambientlotag));
for (i = 0; i < numsectors; i++)
for(auto&sec : sectors())
{
auto sectp = &sector[i];
auto sectp = &sec;
sectp->extra = 256;
switch (sectp->lotag)
@ -712,8 +710,8 @@ void prelevel_common(int g)
if (sectp->ceilingpicnum == TILE_CLOUDYSKIES && numclouds < 127)
clouds[numclouds++] = sectp;
if (ps[0].one_parallax_sectnum == -1)
ps[0].one_parallax_sectnum = i;
if (ps[0].one_parallax_sectnum == nullptr)
ps[0].one_parallax_sectnum = sectp;
}
if (sectp->lotag == 32767) //Found a secret room

View file

@ -211,7 +211,8 @@ struct player_struct
int aim_mode, ftt;
int cursectnum, one_parallax_sectnum; // wall + sector references. Make them pointers later?
int cursectnum;
sectortype* one_parallax_sectnum; // wall + sector references. Make them pointers later?
walltype* access_wall;
short last_extra, subweapon;
@ -311,11 +312,6 @@ struct player_struct
{
return &::sector[cursectnum];
}
sectortype* one_parallax_sector() const
{
return &::sector[one_parallax_sectnum];
}
};

View file

@ -159,7 +159,7 @@ struct DukePlayer
native int randomflamex, crack_time;
native int aim_mode, ftt;
native int cursectnum, one_parallax_sectnum;
//native int cursectnum;// , one_parallax_sectnum
//native walltype access_wall; // can't do yet.
native int16 last_extra, subweapon;