- Blood: Floatified playerStart() and ZONE::ang.

This commit is contained in:
Mitchell Richters 2022-09-25 21:45:33 +10:00 committed by Christoph Oelckers
parent 243c071834
commit b8b5fe9162
4 changed files with 12 additions and 13 deletions

View file

@ -294,18 +294,18 @@ void StartLevel(MapRecord* level, bool newgame)
for (int i = 0; i < kMaxPlayers; i++) {
gStartZone[i].pos = startpos;
gStartZone[i].sector = startsector;
gStartZone[i].ang = startang;
gStartZone[i].angle = DAngle::fromBuild(startang);
#ifdef NOONE_EXTENSIONS
// Create spawn zones for players in teams mode.
if (gModernMap && i <= kMaxPlayers / 2) {
gStartZoneTeam1[i].pos = startpos;
gStartZoneTeam1[i].sector = startsector;
gStartZoneTeam1[i].ang = startang;
gStartZoneTeam1[i].angle = DAngle::fromBuild(startang);
gStartZoneTeam2[i].pos = startpos;
gStartZoneTeam2[i].sector = startsector;
gStartZoneTeam2[i].ang = startang;
gStartZoneTeam2[i].angle = DAngle::fromBuild(startang);
}
#endif
}

View file

@ -60,7 +60,7 @@ void WeaponPrecache();
struct ZONE {
DVector3 pos;
sectortype* sector;
short ang;
DAngle angle;
};
extern ZONE gStartZone[8];

View file

@ -806,12 +806,11 @@ void playerStart(int nPlayer, int bNewLevel)
seqSpawn(pDudeInfo->seqStartID, actor, -1);
if (nPlayer == myconnectindex)
actor->spr.cstat2 |= CSTAT2_SPRITE_MAPPED;
int top, bottom;
double top, bottom;
GetActorExtents(actor, &top, &bottom);
actor->add_int_z(-(bottom - actor->int_pos().Z));
actor->spr.pos.Z -= bottom - actor->spr.pos.Z;
actor->spr.pal = 11 + (pPlayer->teamId & 3);
actor->set_int_ang(pStartZone->ang);
pPlayer->angle.ang = actor->spr.angle;
actor->spr.angle = pPlayer->angle.ang = pStartZone->angle;
actor->spr.type = kDudePlayer1 + nPlayer;
actor->set_native_clipdist(pDudeInfo->clipdist);
actor->spr.flags = 15;

View file

@ -85,7 +85,7 @@ void warpInit(TArray<DBloodActor*>& actors)
ZONE* pZone = &gStartZone[actor->xspr.data1];
pZone->pos = actor->spr.pos;
pZone->sector = actor->sector();
pZone->ang = actor->int_ang();
pZone->angle = actor->spr.angle;
}
DeleteSprite(actor);
break;
@ -96,7 +96,7 @@ void warpInit(TArray<DBloodActor*>& actors)
ZONE* pZone = &gStartZone[actor->xspr.data1];
pZone->pos = actor->spr.pos;
pZone->sector = actor->sector();
pZone->ang = actor->int_ang();
pZone->angle = actor->spr.angle;
#ifdef NOONE_EXTENSIONS
// fill player spawn position according team of player in TEAMS mode.
@ -105,7 +105,7 @@ void warpInit(TArray<DBloodActor*>& actors)
pZone = &gStartZoneTeam1[team1];
pZone->pos = actor->spr.pos;
pZone->sector = actor->sector();
pZone->ang = actor->int_ang();
pZone->angle = actor->spr.angle;
team1++;
}
@ -113,7 +113,7 @@ void warpInit(TArray<DBloodActor*>& actors)
pZone = &gStartZoneTeam2[team2];
pZone->pos = actor->spr.pos;
pZone->sector = actor->sector();
pZone->ang = actor->int_ang();
pZone->angle = actor->spr.angle;
team2++;
}
}
@ -317,7 +317,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, ZONE& w, ZONE* def
{
arc("pos", w.pos)
("sector", w.sector)
("angle", w.ang)
("angle", w.angle)
.EndObject();
}
return arc;