2019-09-19 22:42:45 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-09-21 18:59:54 +00:00
|
|
|
#include "ns.h" // Must come before everything else!
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
#include "build.h"
|
2020-12-09 14:56:32 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
#include "blood.h"
|
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
ZONE gStartZone[8];
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
ZONE gStartZoneTeam1[8];
|
|
|
|
ZONE gStartZoneTeam2[8];
|
|
|
|
bool gTeamsSpawnUsed = false;
|
|
|
|
#endif
|
2021-12-16 10:52:19 +00:00
|
|
|
|
|
|
|
void validateLinks()
|
|
|
|
{
|
|
|
|
int snum = 0;
|
2021-12-21 08:23:39 +00:00
|
|
|
for (auto& sect: sector)
|
2021-12-16 10:52:19 +00:00
|
|
|
{
|
2021-12-05 16:35:23 +00:00
|
|
|
DCoreActor* upper = sect.upperLink;
|
|
|
|
if (upper && !static_cast<DBloodActor*>(upper)->GetOwner())
|
2021-12-16 10:52:19 +00:00
|
|
|
{
|
2021-12-16 10:56:26 +00:00
|
|
|
Printf(PRINT_HIGH, "Unpartnered upper link in sector %d\n", snum);
|
2021-11-20 17:42:19 +00:00
|
|
|
sect.upperLink = nullptr;
|
2021-12-16 10:52:19 +00:00
|
|
|
}
|
2021-12-05 16:35:23 +00:00
|
|
|
DCoreActor* lower = sect.lowerLink;
|
|
|
|
if (lower && !static_cast<DBloodActor*>(lower)->GetOwner())
|
2021-12-16 10:52:19 +00:00
|
|
|
{
|
2021-11-20 17:42:19 +00:00
|
|
|
Printf(PRINT_HIGH, "Unpartnered lower link in sector %d\n", snum);
|
|
|
|
sect.lowerLink = nullptr;
|
2021-12-16 10:52:19 +00:00
|
|
|
}
|
|
|
|
snum++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-03 20:36:32 +00:00
|
|
|
|
|
|
|
void warpInit(TArray<DBloodActor*>& actors)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-11-08 19:57:01 +00:00
|
|
|
int team1 = 0; int team2 = 0; gTeamsSpawnUsed = false; // increment if team start positions specified.
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2021-12-03 20:36:32 +00:00
|
|
|
|
|
|
|
for(auto actor : actors)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-03 20:36:32 +00:00
|
|
|
if (!actor->exists()) continue;
|
2021-09-05 07:24:28 +00:00
|
|
|
spritetype* pSprite = &actor->s();
|
|
|
|
if (actor->hasX()) {
|
|
|
|
XSPRITE *pXSprite = &actor->x();
|
2019-10-11 21:59:39 +00:00
|
|
|
switch (pSprite->type) {
|
|
|
|
case kMarkerSPStart:
|
|
|
|
if (gGameOptions.nGameType < 2 && pXSprite->data1 >= 0 && pXSprite->data1 < kMaxPlayers) {
|
|
|
|
ZONE *pZone = &gStartZone[pXSprite->data1];
|
2021-12-22 10:57:10 +00:00
|
|
|
pZone->x = pSprite->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
pZone->y = pSprite->pos.Y;
|
2019-09-19 22:42:45 +00:00
|
|
|
pZone->z = pSprite->z;
|
2021-11-23 23:55:57 +00:00
|
|
|
pZone->sector = pSprite->sector();
|
2019-09-19 22:42:45 +00:00
|
|
|
pZone->ang = pSprite->ang;
|
2019-10-11 21:59:39 +00:00
|
|
|
}
|
2021-09-05 07:24:28 +00:00
|
|
|
DeleteSprite(actor);
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
|
|
|
case kMarkerMPStart:
|
|
|
|
if (pXSprite->data1 >= 0 && pXSprite->data2 < kMaxPlayers) {
|
|
|
|
if (gGameOptions.nGameType >= 2) {
|
|
|
|
// default if BB or teams without data2 specified
|
|
|
|
ZONE* pZone = &gStartZone[pXSprite->data1];
|
2021-12-22 10:57:10 +00:00
|
|
|
pZone->x = pSprite->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
pZone->y = pSprite->pos.Y;
|
2019-10-11 21:59:39 +00:00
|
|
|
pZone->z = pSprite->z;
|
2021-11-23 23:55:57 +00:00
|
|
|
pZone->sector = pSprite->sector();
|
2019-10-11 21:59:39 +00:00
|
|
|
pZone->ang = pSprite->ang;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
// fill player spawn position according team of player in TEAMS mode.
|
|
|
|
if (gModernMap && gGameOptions.nGameType == 3) {
|
|
|
|
if (pXSprite->data2 == 1) {
|
|
|
|
pZone = &gStartZoneTeam1[team1];
|
2021-12-22 10:57:10 +00:00
|
|
|
pZone->x = pSprite->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
pZone->y = pSprite->pos.Y;
|
2020-01-26 11:19:01 +00:00
|
|
|
pZone->z = pSprite->z;
|
2021-11-23 23:55:57 +00:00
|
|
|
pZone->sector = pSprite->sector();
|
2020-01-26 11:19:01 +00:00
|
|
|
pZone->ang = pSprite->ang;
|
|
|
|
team1++;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
} else if (pXSprite->data2 == 2) {
|
|
|
|
pZone = &gStartZoneTeam2[team2];
|
2021-12-22 10:57:10 +00:00
|
|
|
pZone->x = pSprite->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
pZone->y = pSprite->pos.Y;
|
2020-01-26 11:19:01 +00:00
|
|
|
pZone->z = pSprite->z;
|
2021-11-23 23:55:57 +00:00
|
|
|
pZone->sector = pSprite->sector();
|
2020-01-26 11:19:01 +00:00
|
|
|
pZone->ang = pSprite->ang;
|
|
|
|
team2++;
|
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2021-09-05 07:24:28 +00:00
|
|
|
DeleteSprite(actor);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
|
|
|
case kMarkerUpLink:
|
2021-11-20 17:42:19 +00:00
|
|
|
pSprite->sector()->upperLink = actor;
|
2021-12-18 15:02:15 +00:00
|
|
|
pSprite->cstat |= CSTAT_SPRITE_INVISIBLE;
|
2021-12-18 15:09:58 +00:00
|
|
|
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
|
|
|
case kMarkerLowLink:
|
2021-11-20 17:42:19 +00:00
|
|
|
pSprite->sector()->lowerLink = actor;
|
2021-12-18 15:02:15 +00:00
|
|
|
pSprite->cstat |= CSTAT_SPRITE_INVISIBLE;
|
2021-12-18 15:09:58 +00:00
|
|
|
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
|
|
|
case kMarkerUpWater:
|
|
|
|
case kMarkerUpStack:
|
|
|
|
case kMarkerUpGoo:
|
2021-11-20 17:42:19 +00:00
|
|
|
pSprite->sector()->upperLink = actor;
|
2021-12-18 15:02:15 +00:00
|
|
|
pSprite->cstat |= CSTAT_SPRITE_INVISIBLE;
|
2021-12-18 15:09:58 +00:00
|
|
|
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-12-22 11:17:17 +00:00
|
|
|
pSprite->z = getflorzofslopeptr(pSprite->sector(), pSprite->pos.X, pSprite->pos.Y);
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
|
|
|
case kMarkerLowWater:
|
|
|
|
case kMarkerLowStack:
|
|
|
|
case kMarkerLowGoo:
|
2021-11-20 17:42:19 +00:00
|
|
|
pSprite->sector()->lowerLink = actor;
|
2021-12-18 15:02:15 +00:00
|
|
|
pSprite->cstat |= CSTAT_SPRITE_INVISIBLE;
|
2021-12-18 15:09:58 +00:00
|
|
|
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-12-22 11:17:17 +00:00
|
|
|
pSprite->z = getceilzofslopeptr(pSprite->sector(), pSprite->pos.X, pSprite->pos.Y);
|
2019-10-11 21:59:39 +00:00
|
|
|
break;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-11-08 19:57:01 +00:00
|
|
|
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
2019-09-19 22:42:45 +00:00
|
|
|
// check if there is enough start positions for teams, if any used
|
|
|
|
if (team1 > 0 || team2 > 0) {
|
|
|
|
gTeamsSpawnUsed = true;
|
2019-11-08 19:57:01 +00:00
|
|
|
if (team1 < kMaxPlayers / 2 || team2 < kMaxPlayers / 2) {
|
|
|
|
viewSetSystemMessage("At least 4 spawn positions for each team is recommended.");
|
|
|
|
viewSetSystemMessage("Team A positions: %d, Team B positions: %d.", team1, team2);
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2020-01-26 11:19:01 +00:00
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2021-12-21 08:23:39 +00:00
|
|
|
for(auto& sect: sector)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-05 23:50:33 +00:00
|
|
|
auto actor = barrier_cast<DBloodActor*>(sect.upperLink);
|
2021-09-05 07:24:28 +00:00
|
|
|
if (actor && actor->hasX())
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-09-05 07:24:28 +00:00
|
|
|
spritetype *pSprite = &actor->s();
|
|
|
|
XSPRITE *pXSprite = &actor->x();
|
2019-09-19 22:42:45 +00:00
|
|
|
int nLink = pXSprite->data1;
|
2021-12-21 08:23:39 +00:00
|
|
|
for(auto& sect: sector)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-05 23:50:33 +00:00
|
|
|
auto actor2 = barrier_cast<DBloodActor*>(sect.lowerLink);
|
2021-09-05 07:24:28 +00:00
|
|
|
if (actor2 && actor2->hasX())
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-09-05 07:24:28 +00:00
|
|
|
spritetype *pSprite2 = &actor2->s();
|
|
|
|
XSPRITE *pXSprite2 = &actor2->x();
|
2019-09-19 22:42:45 +00:00
|
|
|
if (pXSprite2->data1 == nLink)
|
|
|
|
{
|
2021-09-05 07:24:28 +00:00
|
|
|
actor->SetOwner(actor2);
|
|
|
|
actor2->SetOwner(actor);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-16 10:52:19 +00:00
|
|
|
validateLinks();
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2021-09-04 07:37:17 +00:00
|
|
|
int CheckLink(DBloodActor *actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-09-04 07:37:17 +00:00
|
|
|
auto pSprite = &actor->s();
|
2021-11-24 01:11:00 +00:00
|
|
|
auto pSector = pSprite->sector();
|
2021-12-05 23:50:33 +00:00
|
|
|
auto aUpper = barrier_cast<DBloodActor*>(pSector->upperLink);
|
|
|
|
auto aLower = barrier_cast<DBloodActor*>(pSector->lowerLink);
|
2021-09-04 07:37:17 +00:00
|
|
|
if (aUpper)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-09-04 07:37:17 +00:00
|
|
|
spritetype* pUpper = &aUpper->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
int z;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pUpper->type == kMarkerUpLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z = pUpper->z;
|
|
|
|
else
|
2021-12-22 11:17:17 +00:00
|
|
|
z = getflorzofslopeptr(pSprite->sector(), pSprite->pos.X, pSprite->pos.Y);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (z <= pSprite->z)
|
|
|
|
{
|
2021-09-04 07:37:17 +00:00
|
|
|
aLower = aUpper->GetOwner();
|
|
|
|
assert(aLower);
|
|
|
|
spritetype *pLower = &aLower->s();
|
2021-11-24 01:11:00 +00:00
|
|
|
assert(pLower->insector());
|
2021-11-23 23:41:19 +00:00
|
|
|
ChangeActorSect(actor, pLower->sector());
|
2021-12-22 10:57:10 +00:00
|
|
|
pSprite->pos.X += pLower->pos.X - pUpper->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
pSprite->pos.Y += pLower->pos.Y - pUpper->pos.Y;
|
2019-09-19 22:42:45 +00:00
|
|
|
int z2;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pLower->type == kMarkerLowLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z2 = pLower->z;
|
|
|
|
else
|
2021-12-22 11:17:17 +00:00
|
|
|
z2 = getceilzofslopeptr(pSprite->sector(), pSprite->pos.X, pSprite->pos.Y);
|
2019-09-19 22:42:45 +00:00
|
|
|
pSprite->z += z2-z;
|
2021-09-05 10:35:13 +00:00
|
|
|
actor->interpolated = false;
|
2019-09-19 22:42:45 +00:00
|
|
|
return pUpper->type;
|
|
|
|
}
|
|
|
|
}
|
2021-09-04 07:37:17 +00:00
|
|
|
if (aLower)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-09-04 07:37:17 +00:00
|
|
|
spritetype *pLower = &aLower->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
int z;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pLower->type == kMarkerLowLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z = pLower->z;
|
|
|
|
else
|
2021-12-22 11:17:17 +00:00
|
|
|
z = getceilzofslopeptr(pSprite->sector(), pSprite->pos.X, pSprite->pos.Y);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (z >= pSprite->z)
|
|
|
|
{
|
2021-09-04 07:37:17 +00:00
|
|
|
aUpper = aLower->GetOwner();
|
|
|
|
assert(aUpper);
|
|
|
|
spritetype *pUpper = &aUpper->s();
|
2021-11-24 01:11:00 +00:00
|
|
|
assert(pUpper->insector());
|
2021-11-23 23:41:19 +00:00
|
|
|
ChangeActorSect(actor, pUpper->sector());
|
2021-12-22 10:57:10 +00:00
|
|
|
pSprite->pos.X += pUpper->pos.X - pLower->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
pSprite->pos.Y += pUpper->pos.Y - pLower->pos.Y;
|
2019-09-19 22:42:45 +00:00
|
|
|
int z2;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pUpper->type == kMarkerUpLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z2 = pUpper->z;
|
|
|
|
else
|
2021-12-22 11:17:17 +00:00
|
|
|
z2 = getflorzofslopeptr(pSprite->sector(), pSprite->pos.X, pSprite->pos.Y);
|
2019-09-19 22:42:45 +00:00
|
|
|
pSprite->z += z2-z;
|
2021-09-05 10:35:13 +00:00
|
|
|
actor->interpolated = false;
|
2019-09-19 22:42:45 +00:00
|
|
|
return pLower->type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-11-24 00:55:55 +00:00
|
|
|
int CheckLink(int *x, int *y, int *z, sectortype** pSector)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-05 23:50:33 +00:00
|
|
|
auto upper = barrier_cast<DBloodActor*>((*pSector)->upperLink);
|
|
|
|
auto lower = barrier_cast<DBloodActor*>((*pSector)->lowerLink);
|
2021-09-05 07:24:28 +00:00
|
|
|
if (upper)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-09-05 07:24:28 +00:00
|
|
|
spritetype *pUpper = &upper->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
int z1;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pUpper->type == kMarkerUpLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z1 = pUpper->z;
|
|
|
|
else
|
2021-11-24 00:55:55 +00:00
|
|
|
z1 = getflorzofslopeptr(*pSector, *x, *y);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (z1 <= *z)
|
|
|
|
{
|
2021-09-05 07:24:28 +00:00
|
|
|
lower = upper->GetOwner();
|
|
|
|
assert(lower);
|
|
|
|
spritetype *pLower = &lower->s();
|
2021-11-24 01:11:00 +00:00
|
|
|
assert(pLower->insector());
|
2021-11-24 00:55:55 +00:00
|
|
|
*pSector = pLower->sector();
|
2021-12-22 10:57:10 +00:00
|
|
|
*x += pLower->pos.X - pUpper->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
*y += pLower->pos.Y - pUpper->pos.Y;
|
2019-09-19 22:42:45 +00:00
|
|
|
int z2;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pUpper->type == kMarkerLowLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z2 = pLower->z;
|
|
|
|
else
|
2021-11-24 00:55:55 +00:00
|
|
|
z2 = getceilzofslopeptr(*pSector, *x, *y);
|
2019-09-19 22:42:45 +00:00
|
|
|
*z += z2-z1;
|
|
|
|
return pUpper->type;
|
|
|
|
}
|
|
|
|
}
|
2021-09-05 07:24:28 +00:00
|
|
|
if (lower)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-09-05 07:24:28 +00:00
|
|
|
spritetype *pLower = &lower->s();
|
2019-09-19 22:42:45 +00:00
|
|
|
int z1;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pLower->type == kMarkerLowLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z1 = pLower->z;
|
|
|
|
else
|
2021-11-24 00:55:55 +00:00
|
|
|
z1 = getceilzofslopeptr(*pSector, *x, *y);
|
2019-09-19 22:42:45 +00:00
|
|
|
if (z1 >= *z)
|
|
|
|
{
|
2021-09-05 07:24:28 +00:00
|
|
|
upper = lower->GetOwner();
|
|
|
|
assert(upper);
|
|
|
|
spritetype *pUpper = &upper->s();
|
2021-11-24 00:55:55 +00:00
|
|
|
assert(pUpper);
|
|
|
|
*pSector = pUpper->sector();
|
2021-12-22 10:57:10 +00:00
|
|
|
*x += pUpper->pos.X - pLower->pos.X;
|
2021-12-22 11:17:17 +00:00
|
|
|
*y += pUpper->pos.Y - pLower->pos.Y;
|
2019-09-19 22:42:45 +00:00
|
|
|
int z2;
|
2019-10-19 19:11:39 +00:00
|
|
|
if (pLower->type == kMarkerUpLink)
|
2019-09-19 22:42:45 +00:00
|
|
|
z2 = pUpper->z;
|
|
|
|
else
|
2021-11-24 00:55:55 +00:00
|
|
|
z2 = getflorzofslopeptr(*pSector, *x, *y);
|
2019-09-19 22:42:45 +00:00
|
|
|
*z += z2-z1;
|
|
|
|
return pLower->type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-11-21 18:39:24 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
FSerializer& Serialize(FSerializer& arc, const char* keyname, ZONE& w, ZONE* def)
|
|
|
|
{
|
|
|
|
if (arc.BeginObject(keyname))
|
|
|
|
{
|
|
|
|
arc("x", w.x)
|
|
|
|
("y", w.y)
|
|
|
|
("z", w.z)
|
2021-11-23 23:55:57 +00:00
|
|
|
("sector", w.sector)
|
2020-11-21 18:39:24 +00:00
|
|
|
("angle", w.ang)
|
|
|
|
.EndObject();
|
|
|
|
}
|
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SerializeWarp(FSerializer& arc)
|
|
|
|
{
|
|
|
|
if (arc.BeginObject("warp"))
|
|
|
|
{
|
|
|
|
arc.Array("startzone", gStartZone, kMaxPlayers)
|
|
|
|
.EndObject();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
END_BLD_NS
|