Skip to content

Commit

Permalink
- Added the usable parts of Rachael's 'Spawnmulti' spawn flag PR.
Browse files Browse the repository at this point in the history
This needed a small fix in SpawnMapThing to apply the correct flags for Hexen format maps.
  • Loading branch information
coelckers committed Oct 25, 2020
1 parent 38eb6db commit 3bd365f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/gamedata/g_mapinfo.h
Expand Up @@ -473,6 +473,7 @@ enum ESkillProperty
SKILLP_SlowMonsters,
SKILLP_Infight,
SKILLP_PlayerRespawn,
SKILLP_SpawnMulti,
};
enum EFSkillProperty // floating point properties
{
Expand Down Expand Up @@ -516,6 +517,7 @@ struct FSkillInfo
int RespawnLimit;
double Aggressiveness;
int SpawnFilter;
bool SpawnMulti;
int ACSReturn;
FString MenuName;
FString PicName;
Expand Down
7 changes: 7 additions & 0 deletions src/gamedata/g_skill.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/playsim/p_mobj.cpp
Expand Up @@ -5354,7 +5354,6 @@ AActor *FLevelLocals::SpawnPlayer (FPlayerStart *mthing, int playernum, int flag
return mobj;
}


//
// P_SpawnMapThing
// The fields of the mapthing should
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3bd365f

Please sign in to comment.