mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 04:01:31 +00:00
add SpawnMultiCoopOnly mapinfo flag to spawn **only** coop spawns in single-player
This commit is contained in:
parent
5895f9b1b1
commit
afcd38907c
4 changed files with 17 additions and 3 deletions
|
@ -510,6 +510,7 @@ enum ESkillProperty
|
|||
SKILLP_PlayerRespawn,
|
||||
SKILLP_SpawnMulti,
|
||||
SKILLP_InstantReaction,
|
||||
SKILLP_SpawnMultiCoopOnly,
|
||||
};
|
||||
enum EFSkillProperty // floating point properties
|
||||
{
|
||||
|
@ -555,6 +556,7 @@ struct FSkillInfo
|
|||
int SpawnFilter;
|
||||
bool SpawnMulti;
|
||||
bool InstantReaction;
|
||||
bool SpawnMultiCoopOnly;
|
||||
int ACSReturn;
|
||||
FString MenuName;
|
||||
FString PicName;
|
||||
|
|
|
@ -77,6 +77,7 @@ void FMapInfoParser::ParseSkill ()
|
|||
skill.Aggressiveness = 1.;
|
||||
skill.SpawnFilter = 0;
|
||||
skill.SpawnMulti = false;
|
||||
skill.SpawnMultiCoopOnly = false;
|
||||
skill.InstantReaction = false;
|
||||
skill.ACSReturn = 0;
|
||||
skill.MustConfirm = false;
|
||||
|
@ -198,6 +199,10 @@ void FMapInfoParser::ParseSkill ()
|
|||
{
|
||||
skill.SpawnMulti = true;
|
||||
}
|
||||
else if (sc.Compare ("spawnmulticooponly"))
|
||||
{
|
||||
skill.SpawnMultiCoopOnly = true;
|
||||
}
|
||||
else if (sc.Compare ("InstantReaction"))
|
||||
{
|
||||
skill.InstantReaction = true;
|
||||
|
@ -408,9 +413,13 @@ int G_SkillProperty(ESkillProperty prop)
|
|||
|
||||
case SKILLP_SpawnMulti:
|
||||
return AllSkills[gameskill].SpawnMulti;
|
||||
|
||||
|
||||
case SKILLP_InstantReaction:
|
||||
return AllSkills[gameskill].InstantReaction;
|
||||
|
||||
case SKILLP_SpawnMultiCoopOnly:
|
||||
return AllSkills[gameskill].SpawnMultiCoopOnly;
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -550,6 +559,7 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
|
|||
SpawnFilter = other.SpawnFilter;
|
||||
SpawnMulti = other.SpawnMulti;
|
||||
InstantReaction = other.InstantReaction;
|
||||
SpawnMultiCoopOnly = other.SpawnMultiCoopOnly;
|
||||
ACSReturn = other.ACSReturn;
|
||||
MenuName = other.MenuName;
|
||||
PicName = other.PicName;
|
||||
|
|
|
@ -5757,6 +5757,7 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
|
|||
AActor *mobj;
|
||||
|
||||
bool spawnmulti = G_SkillProperty(SKILLP_SpawnMulti) || !!(dmflags2 & DF2_ALWAYS_SPAWN_MULTI);
|
||||
bool spawnmulti_cooponly = G_SkillProperty(SKILLP_SpawnMultiCoopOnly);
|
||||
|
||||
if (mthing->EdNum == 0 || mthing->EdNum == -1)
|
||||
return NULL;
|
||||
|
@ -5837,9 +5838,9 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
|
|||
{
|
||||
mask = MTF_COOPERATIVE;
|
||||
}
|
||||
else if (spawnmulti)
|
||||
else if (spawnmulti || spawnmulti_cooponly)
|
||||
{
|
||||
mask = MTF_COOPERATIVE|MTF_SINGLE;
|
||||
mask = spawnmulti_cooponly ? MTF_COOPERATIVE : (MTF_COOPERATIVE|MTF_SINGLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1024,6 +1024,7 @@ enum ESkillProperty
|
|||
SKILLP_PlayerRespawn,
|
||||
SKILLP_SpawnMulti,
|
||||
SKILLP_InstantReaction,
|
||||
SKILLP_SpawnMultiCoopOnly,
|
||||
};
|
||||
enum EFSkillProperty // floating point properties
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue