- Added UsePlayerStartZ MAPINFO option to cause P_SpawnPlayer() to offset the spawned player's

Z position by the MapThing's Z, just like for any other MapThing.
- P_SpawnPlayer() now respects a player's SPAWNCEILING and SPAWNFLOAT flags.

SVN r3746 (trunk)
This commit is contained in:
Randy Heit 2012-07-07 03:18:09 +00:00
parent f6ff2ea8a7
commit f0d60ddcee
3 changed files with 20 additions and 3 deletions

View file

@ -162,7 +162,7 @@ enum ELevelFlags
LEVEL_STARTLIGHTNING = 0x01000000, // Automatically start lightning
LEVEL_FILTERSTARTS = 0x02000000, // Apply mapthing filtering to player starts
LEVEL_LOOKUPLEVELNAME = 0x04000000, // Level name is the name of a language string
//LEVEL_HEXENFORMAT = 0x08000000, // Level uses the Hexen map format
LEVEL_USEPLAYERSTARTZ = 0x08000000, // Use the Z position of player starts
LEVEL_SWAPSKIES = 0x10000000, // Used by lightning
LEVEL_NOALLIES = 0x20000000, // i.e. Inside Strife's front base

View file

@ -1208,6 +1208,7 @@ MapFlagHandlers[] =
{ "nofallingdamage", MITYPE_SCFLAGS, 0, ~(LEVEL_FALLDMG_ZD|LEVEL_FALLDMG_HX) },
{ "noallies", MITYPE_SETFLAG, LEVEL_NOALLIES, 0 },
{ "filterstarts", MITYPE_SETFLAG, LEVEL_FILTERSTARTS, 0 },
{ "useplayerstartz", MITYPE_SETFLAG, LEVEL_USEPLAYERSTARTZ, 0 },
{ "activateowndeathspecials", MITYPE_SETFLAG, LEVEL_ACTOWNSPECIAL, 0 },
{ "killeractivatesdeathspecials", MITYPE_CLRFLAG, LEVEL_ACTOWNSPECIAL, 0 },
{ "missilesactivateimpactlines", MITYPE_SETFLAG2, LEVEL2_MISSILESACTIVATEIMPACT, 0 },

View file

@ -4080,7 +4080,7 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
player_t *p;
APlayerPawn *mobj, *oldactor;
BYTE state;
fixed_t spawn_x, spawn_y;
fixed_t spawn_x, spawn_y, spawn_z;
angle_t spawn_angle;
// [RH] Things 4001-? are also multiplayer starts. Just like 1-4.
@ -4160,8 +4160,24 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
}
}
if (GetDefaultByType(p->cls)->flags & MF_SPAWNCEILING)
spawn_z = ONCEILINGZ;
else if (GetDefaultByType(p->cls)->flags2 & MF2_SPAWNFLOAT)
spawn_z = FLOATRANDZ;
else
spawn_z = ONFLOORZ;
mobj = static_cast<APlayerPawn *>
(Spawn (p->cls, spawn_x, spawn_y, ONFLOORZ, NO_REPLACE));
(Spawn (p->cls, spawn_x, spawn_y, spawn_z, NO_REPLACE));
if (level.flags & LEVEL_USEPLAYERSTARTZ)
{
if (spawn_z == ONFLOORZ)
mobj->z += mthing->z;
else if (spawn_z == ONCEILINGZ)
mobj->z -= mthing->z;
P_FindFloorCeiling(mobj, FFCF_SAMESECTOR | FFCF_ONLY3DFLOORS | FFCF_3DRESTRICT);
}
mobj->FriendPlayer = playernum + 1; // [RH] players are their own friends
oldactor = p->mo;