mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-11 05:01:09 +00:00
Added level transition spawning for missing starts
- Additional player bodies are spawned for any absent starts in co-op. - Removed now-redundant bot start limitation
This commit is contained in:
parent
409525cde6
commit
c1e362ee83
3 changed files with 66 additions and 63 deletions
|
@ -369,14 +369,6 @@ bool FCajunMaster::DoAddBot (BYTE *info, botskill_t skill)
|
||||||
|
|
||||||
D_ReadUserInfoStrings (bnum, &info, false);
|
D_ReadUserInfoStrings (bnum, &info, false);
|
||||||
|
|
||||||
if (!deathmatch && playerstarts[bnum].type == 0)
|
|
||||||
{
|
|
||||||
Printf ("%s tried to join, but there was no player %d start\n",
|
|
||||||
players[bnum].userinfo.GetName(), bnum+1);
|
|
||||||
ClearPlayer (bnum, false); // Make the bot inactive again
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
multiplayer = true; //Prevents cheating and so on; emulates real netgame (almost).
|
multiplayer = true; //Prevents cheating and so on; emulates real netgame (almost).
|
||||||
players[bnum].Bot = new DBot;
|
players[bnum].Bot = new DBot;
|
||||||
players[bnum].Bot->player = &players[bnum];
|
players[bnum].Bot->player = &players[bnum];
|
||||||
|
|
|
@ -1422,6 +1422,8 @@ bool G_CheckSpot (int playernum, FPlayerStart *mthing)
|
||||||
fixed_t z, oldz;
|
fixed_t z, oldz;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (mthing->type == 0) return false;
|
||||||
|
|
||||||
x = mthing->x;
|
x = mthing->x;
|
||||||
y = mthing->y;
|
y = mthing->y;
|
||||||
z = mthing->z;
|
z = mthing->z;
|
||||||
|
|
|
@ -1195,26 +1195,36 @@ void G_FinishTravel ()
|
||||||
TThinkerIterator<APlayerPawn> it (STAT_TRAVELLING);
|
TThinkerIterator<APlayerPawn> it (STAT_TRAVELLING);
|
||||||
APlayerPawn *pawn, *pawndup, *oldpawn, *next;
|
APlayerPawn *pawn, *pawndup, *oldpawn, *next;
|
||||||
AInventory *inv;
|
AInventory *inv;
|
||||||
|
FPlayerStart *start;
|
||||||
|
int pnum;
|
||||||
|
|
||||||
next = it.Next ();
|
next = it.Next ();
|
||||||
while ( (pawn = next) != NULL)
|
while ( (pawn = next) != NULL)
|
||||||
{
|
{
|
||||||
next = it.Next ();
|
next = it.Next ();
|
||||||
|
pnum = (pawn->player - players);
|
||||||
pawn->ChangeStatNum (STAT_PLAYER);
|
pawn->ChangeStatNum (STAT_PLAYER);
|
||||||
pawndup = pawn->player->mo;
|
pawndup = pawn->player->mo;
|
||||||
|
start = NULL;
|
||||||
assert (pawn != pawndup);
|
assert (pawn != pawndup);
|
||||||
if (pawndup == NULL)
|
if (pawndup == NULL)
|
||||||
{ // Oh no! there was no start for this player!
|
{ // Oh no! there was no start for this player!
|
||||||
|
start = G_PickPlayerStart(pnum, PPS_FORCERANDOM);
|
||||||
|
pawndup = P_SpawnPlayer(start, pnum, (level.flags2 & LEVEL2_PRERAISEWEAPON) ? SPF_WEAPONFULLYUP : 0);
|
||||||
|
if (pawndup == NULL)
|
||||||
|
{
|
||||||
pawn->flags |= MF_NOSECTOR | MF_NOBLOCKMAP;
|
pawn->flags |= MF_NOSECTOR | MF_NOBLOCKMAP;
|
||||||
pawn->Destroy();
|
pawn->Destroy();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
|
if (start == NULL) start = G_PickPlayerStart(pnum, 0);
|
||||||
oldpawn = pawndup;
|
oldpawn = pawndup;
|
||||||
|
|
||||||
// The player being spawned here is a short lived dummy and
|
// The player being spawned here is a short lived dummy and
|
||||||
// must not start any ENTER script or big problems will happen.
|
// must not start any ENTER script or big problems will happen.
|
||||||
pawndup = P_SpawnPlayer (&playerstarts[pawn->player - players], int(pawn->player - players), SPF_TEMPPLAYER);
|
pawndup = P_SpawnPlayer(start, pnum, SPF_TEMPPLAYER);
|
||||||
if (!(changeflags & CHANGELEVEL_KEEPFACING))
|
if (!(changeflags & CHANGELEVEL_KEEPFACING))
|
||||||
{
|
{
|
||||||
pawn->angle = pawndup->angle;
|
pawn->angle = pawndup->angle;
|
||||||
|
@ -1264,7 +1274,6 @@ void G_FinishTravel ()
|
||||||
FBehavior::StaticStartTypedScripts (SCRIPT_Return, pawn, true);
|
FBehavior::StaticStartTypedScripts (SCRIPT_Return, pawn, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bglobal.FinishTravel ();
|
bglobal.FinishTravel ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue