- springboard

This commit is contained in:
Christoph Oelckers 2021-11-25 17:02:27 +01:00
parent 0345615518
commit 959c3bc18b
3 changed files with 10 additions and 16 deletions

View file

@ -1553,19 +1553,13 @@ extern SINE_WALL SineWall[MAX_SINE_WALL][MAX_SINE_WALL_POINTS];
struct SPRING_BOARD
{
int Sector, TimeOut;
sectortype* sectp;
int TimeOut;
};
extern SPRING_BOARD SpringBoard[20];
extern SWING Rotate[17];
typedef struct
{
int sector, speed;
int xmid, ymid;
} SPIN;
extern SPIN Spin[17];
extern DOOR_AUTO_CLOSE DoorAutoClose[MAX_DOOR_AUTO_CLOSE];
#define MAXANIM 256

View file

@ -935,7 +935,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SINE_WALL& w, SINE
FSerializer& Serialize(FSerializer& arc, const char* keyname, SPRING_BOARD& w, SPRING_BOARD* def)
{
static SPRING_BOARD nul = { -1,-1 };
static SPRING_BOARD nul = { nullptr,-1 };
if (!def)
{
def = &nul;
@ -944,7 +944,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SPRING_BOARD& w, S
if (arc.BeginObject(keyname))
{
arc("sector", w.Sector, def->Sector)
arc("sector", w.sectp, def->sectp)
("timeout", w.TimeOut, def->TimeOut)
.EndObject();
}

View file

@ -387,7 +387,7 @@ void SectorSetup(void)
}
memset(SineWaveFloor, 0, sizeof(SineWaveFloor));
memset(SpringBoard, -1, sizeof(SpringBoard));
memset(SpringBoard, 0, sizeof(SpringBoard));
LevelSecrets = 0;
@ -626,19 +626,19 @@ void DoSpringBoardDown(void)
sbp = &SpringBoard[sb];
// if empty set up an entry to close the sb later
if (sbp->Sector != -1)
if (sbp->sectp != nullptr)
{
if ((sbp->TimeOut -= synctics) <= 0)
{
int destz;
destz = nextsectorneighborzptr(sbp->Sector, sector[sbp->Sector].floorz, 1, 1)->floorz;
destz = nextsectorneighborzptr(sbp->sectp, sbp->sectp->floorz, 1, 1)->floorz;
AnimSet(ANIM_Floorz, sbp->Sector, nullptr, destz, 256);
AnimSet(ANIM_Floorz, sbp->sectp, destz, 256);
sector[sbp->Sector].lotag = TAG_SPRING_BOARD;
sbp->sectp->lotag = TAG_SPRING_BOARD;
sbp->Sector = -1;
sbp->sectp = nullptr;
}
}
}