- Added the usable parts of Rachael's 'Spawnmulti' spawn flag PR.

This needed a small fix in SpawnMapThing to apply the correct flags for Hexen format maps.
This commit is contained in:
Christoph Oelckers 2020-10-25 15:57:43 +01:00
parent 38eb6db9ce
commit 3bd365f934
3 changed files with 15 additions and 1 deletions

View file

@ -473,6 +473,7 @@ enum ESkillProperty
SKILLP_SlowMonsters,
SKILLP_Infight,
SKILLP_PlayerRespawn,
SKILLP_SpawnMulti,
};
enum EFSkillProperty // floating point properties
{
@ -516,6 +517,7 @@ struct FSkillInfo
int RespawnLimit;
double Aggressiveness;
int SpawnFilter;
bool SpawnMulti;
int ACSReturn;
FString MenuName;
FString PicName;

View file

@ -76,6 +76,7 @@ void FMapInfoParser::ParseSkill ()
skill.RespawnLimit = 0;
skill.Aggressiveness = 1.;
skill.SpawnFilter = 0;
skill.SpawnMulti = false;
skill.ACSReturn = 0;
skill.MustConfirm = false;
skill.Shortcut = 0;
@ -192,6 +193,10 @@ void FMapInfoParser::ParseSkill ()
else if (sc.Compare("nightmare")) skill.SpawnFilter |= 16;
}
}
else if (sc.Compare ("spawnmulti"))
{
skill.SpawnMulti = true;
}
else if (sc.Compare("ACSReturn"))
{
ParseAssign();
@ -395,6 +400,8 @@ int G_SkillProperty(ESkillProperty prop)
case SKILLP_PlayerRespawn:
return AllSkills[gameskill].PlayerRespawn;
case SKILLP_SpawnMulti:
return AllSkills[gameskill].SpawnMulti;
}
}
return 0;

View file

@ -5354,7 +5354,6 @@ AActor *FLevelLocals::SpawnPlayer (FPlayerStart *mthing, int playernum, int flag
return mobj;
}
//
// P_SpawnMapThing
// The fields of the mapthing should
@ -5367,6 +5366,8 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
int mask;
AActor *mobj;
bool spawnmulti = G_SkillProperty(SKILLP_SpawnMulti) || multiplayer;
if (mthing->EdNum == 0 || mthing->EdNum == -1)
return NULL;
@ -5446,6 +5447,10 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
{
mask = MTF_COOPERATIVE;
}
else if (spawnmulti)
{
mask = MTF_COOPERATIVE|MTF_SINGLE;
}
else
{
mask = MTF_SINGLE;