Skip to content

Commit 70db526

Browse files
committed
Add NOMONSTERS skill flag
1 parent af969f7 commit 70db526

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

prboom2/src/dsda/skill_info.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ void dsda_RefreshGameSkill(void) {
288288
if (respawnparm && !skill_info.respawn_time)
289289
skill_info.respawn_time = 12;
290290

291+
if (nomonsters)
292+
skill_info.flags |= SI_NO_MONSTERS;
293+
291294
if (fastparm)
292295
skill_info.flags |= SI_FAST_MONSTERS;
293296

prboom2/src/dsda/skill_info.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define SI_EASY_BOSS_BRAIN 0x0100
3232
#define SI_MUST_CONFIRM 0x0200
3333
#define SI_AUTO_USE_HEALTH 0x0400
34+
#define SI_NO_MONSTERS 0x1000
3435

3536
typedef uint16_t skill_info_flags_t;
3637

prboom2/src/dsda/wad_stats.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,18 @@ void dsda_WadStatsExitMap(int missed_monsters) {
268268
int skill;
269269
int nightmare_skill;
270270
int best_normal_skill;
271+
int nomo_flag;
271272

272273
if (!current_map_stats || demoplayback)
273274
return;
274275

275276
nightmare_skill = num_skills;
276277
best_normal_skill = num_skills - 1;
277278

278-
if (!nomonsters) {
279+
// Get conditions for recording wad stats
280+
nomo_flag = skill_info.flags & SI_NO_MONSTERS;
281+
282+
if (!nomo_flag) {
279283
skill = gameskill + 1;
280284
if (skill > current_map_stats->best_skill) {
281285
if (current_map_stats->best_skill < best_normal_skill) {

prboom2/src/hexen/a_action.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "p_enemy.h"
2727
#include "p_tick.h"
2828

29+
#include "dsda/skill_info.h"
2930
#include "hexen/p_things.h"
3031

3132
#include "a_action.h"
@@ -118,7 +119,7 @@ void A_PotteryExplode(mobj_t * actor)
118119
S_StartMobjSound(mo, hexen_sfx_pottery_explode);
119120
if (actor->special_args[0])
120121
{ // Spawn an item
121-
if (!nomonsters
122+
if (!(skill_info.flags & SI_NO_MONSTERS)
122123
|| !(mobjinfo[TranslateThingType[actor->special_args[0]]].
123124
flags & MF_COUNTKILL))
124125
{ // Only spawn monsters if not -nomonsters
@@ -831,7 +832,7 @@ void A_SoAExplode(mobj_t * actor)
831832
{ // Spawn an item
832833
// TODO: should this be on or off?
833834
#if 0 // Checks are not present in version 1.1
834-
if (!nomonsters
835+
if (!(skill_info.flags & SI_NO_MONSTERS))
835836
|| !(mobjinfo[TranslateThingType[actor->special_args[0]]].
836837
flags & MF_COUNTKILL))
837838
#endif

prboom2/src/hexen/p_things.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "p_inter.h"
2424
#include "p_tick.h"
2525

26+
#include "dsda/skill_info.h"
2627
#include "hexen/a_action.h"
2728

2829
#include "p_things.h"
@@ -159,7 +160,7 @@ dboolean EV_ThingProjectile(byte * args, dboolean gravity)
159160
searcher = -1;
160161
tid = args[0];
161162
moType = TranslateThingType[args[1]];
162-
if (nomonsters && (mobjinfo[moType].flags & MF_COUNTKILL))
163+
if ((skill_info.flags & SI_NO_MONSTERS) && (mobjinfo[moType].flags & MF_COUNTKILL))
163164
{ // Don't spawn monsters if -nomonsters
164165
return false;
165166
}
@@ -209,7 +210,7 @@ dboolean EV_ThingSpawn(byte * args, dboolean fog)
209210
searcher = -1;
210211
tid = args[0];
211212
moType = TranslateThingType[args[1]];
212-
if (nomonsters && (mobjinfo[moType].flags & MF_COUNTKILL))
213+
if ((skill_info.flags & SI_NO_MONSTERS) && (mobjinfo[moType].flags & MF_COUNTKILL))
213214
{ // Don't spawn monsters if -nomonsters
214215
return false;
215216
}

prboom2/src/p_mobj.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ dboolean P_SpawnProjectile(short thing_id, mobj_t *source, int spawn_num, angle_
15291529

15301530
is_monster = (type == MT_SKULL || (mobjinfo[type].flags & MF_COUNTKILL));
15311531

1532-
if (nomonsters && is_monster)
1532+
if ((skill_info.flags & SI_NO_MONSTERS) && is_monster)
15331533
return false;
15341534

15351535
dsda_ResetThingIDSearch(&search);
@@ -1630,7 +1630,7 @@ dboolean P_SpawnThing(short thing_id, mobj_t *source, int spawn_num,
16301630
if (type == num_mobj_types)
16311631
return false;
16321632

1633-
if (nomonsters && (type == MT_SKULL || (mobjinfo[type].flags & MF_COUNTKILL)))
1633+
if ((skill_info.flags & SI_NO_MONSTERS) && (type == MT_SKULL || (mobjinfo[type].flags & MF_COUNTKILL)))
16341634
return false;
16351635

16361636
dsda_ResetThingIDSearch(&search);
@@ -2539,7 +2539,7 @@ mobj_t* P_SpawnMapThing (const mapthing_t* mthing, int index)
25392539

25402540
// don't spawn any monsters if -nomonsters
25412541

2542-
if (nomonsters && (i == MT_SKULL || (mobjinfo[i].flags & MF_COUNTKILL)))
2542+
if ((skill_info.flags & SI_NO_MONSTERS) && (i == MT_SKULL || (mobjinfo[i].flags & MF_COUNTKILL)))
25432543
return NULL;
25442544

25452545
// spawn it

0 commit comments

Comments
 (0)