- initsect

This commit is contained in:
Christoph Oelckers 2021-11-23 00:41:21 +01:00
parent f09e7ed32f
commit 80f80ed5e5
7 changed files with 13 additions and 11 deletions

View file

@ -57,7 +57,7 @@ extern int initx;
extern int inity;
extern int initz;
extern int16_t inita;
extern int initsect;
extern sectortype* initsectp;
extern int nCurChunkNum;
extern DExhumedActor* nBodyGunSprite[50];

View file

@ -913,7 +913,7 @@ void DrawWeapons(double smooth)
int var_28 = var_30 + WeaponInfo[nWeapon].b[var_34];
int8_t nShade = sector[initsect].ceilingshade;
int8_t nShade = initsectp->ceilingshade;
int nDouble = PlayerList[nLocalPlayer].nDouble;
int nPal = kPalNormal;

View file

@ -41,7 +41,7 @@ enum
int initx, inity, initz;
int16_t inita;
int initsect;
sectortype* initsectp;
int nCurChunkNum = 0;
@ -117,10 +117,12 @@ uint8_t LoadLevel(MapRecord* map)
}
vec3_t startPos;
int initsect;
engineLoadBoard(currentLevel->fileName, 0, &startPos, &inita, &initsect);
initx = startPos.x;
inity = startPos.y;
initz = startPos.z;
initsectp = &sector[initsect];
int i;
@ -159,7 +161,7 @@ void InitLevel(MapRecord* map)
for (int i = 0; i < nTotalPlayers; i++)
{
SetSavePoint(i, initx, inity, initz, &sector[initsect], inita);
SetSavePoint(i, initx, inity, initz, initsectp, inita);
RestartPlayer(i);
InitPlayerKeys(i);
}
@ -735,7 +737,7 @@ void ExamineSprites()
if (nNetPlayerCount)
{
auto pActor = insertActor(initsect, 0);
auto pActor = insertActor(initsectp, 0);
auto pSprite = &pActor->s();
pSprite->x = initx;
@ -816,7 +818,7 @@ void SerializeInit(FSerializer& arc)
("inity", inity)
("initz", initz)
("inita", inita)
("initsect", initsect)
("initsect", initsectp)
("curchunk", nCurChunkNum)
.Array("bodygunsprite", nBodyGunSprite, countof(nBodyGunSprite))
("curbodygun", nCurBodyGunNum)

View file

@ -40,8 +40,8 @@ void GrabMap()
void UpdateMap()
{
if (sector[initsect].ceilingpal != 3 || (PlayerList[nLocalPlayer].nTorch != 0)) {
MarkSectorSeen(initsect);
if (initsectp->ceilingpal != 3 || (PlayerList[nLocalPlayer].nTorch != 0)) {
MarkSectorSeen(sectnum(initsectp));
}
}

View file

@ -1090,7 +1090,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
inity = pSprite->y;
initz = pSprite->z;
inita = pSprite->ang;
initsect = pSprite->sectnum;
initsectp = pSprite->sector();
}
void SetQuake(DExhumedActor* pActor, int nVal)

View file

@ -72,7 +72,7 @@ static int osdcmd_spawn(CCmdFuncPtr parm)
{
if (parm->numparms != 1) return CCMD_SHOWHELP;
auto c = parm->parms[0];
auto sectp = &sector[initsect];
auto sectp = initsectp;
if (!stricmp(c, "anubis")) BuildAnubis(nullptr, initx, inity, sectp->floorz, sectp, inita, false);
else if (!stricmp(c, "spider")) BuildSpider(nullptr, initx, inity, sectp->floorz, sectp, inita);
else if (!stricmp(c, "mummy")) BuildMummy(nullptr, initx, inity, sectp->floorz, sectp, inita);

View file

@ -2553,7 +2553,7 @@ sectdone:
initx = pPlayerSprite->x;
inity = pPlayerSprite->y;
initz = pPlayerSprite->z;
initsect = pPlayerSprite->sectnum;
initsectp = pPlayerSprite->sector();
inita = pPlayerSprite->ang;
}