From 3bd365f9340f4edbfef3cfe6835c1d00a8ed74bf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 25 Oct 2020 15:57:43 +0100 Subject: [PATCH] - 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. --- src/gamedata/g_mapinfo.h | 2 ++ src/gamedata/g_skill.cpp | 7 +++++++ src/playsim/p_mobj.cpp | 7 ++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gamedata/g_mapinfo.h b/src/gamedata/g_mapinfo.h index 30e85bd39..85f649341 100644 --- a/src/gamedata/g_mapinfo.h +++ b/src/gamedata/g_mapinfo.h @@ -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; diff --git a/src/gamedata/g_skill.cpp b/src/gamedata/g_skill.cpp index c47f5d2f1..5963dc878 100644 --- a/src/gamedata/g_skill.cpp +++ b/src/gamedata/g_skill.cpp @@ -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; diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index fb0c661ac..56fcf47ea 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -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;