summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/strife/d_main.c9
-rw-r--r--src/strife/doomstat.h1
-rw-r--r--src/strife/p_mobj.c19
3 files changed, 24 insertions, 5 deletions
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index 01e560a2..a3179359 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -111,6 +111,7 @@ boolean nomonsters; // checkparm of -nomonsters
boolean respawnparm; // checkparm of -respawn
boolean fastparm; // checkparm of -fast
boolean flipparm; // [STRIFE] haleyjd 20110629: checkparm of -flip
+boolean randomparm; // [STRIFE] haleyjd 20130915: checkparm of -random
boolean showintro = true; // [STRIFE] checkparm of -nograph, disables intro
@@ -1435,6 +1436,14 @@ void D_DoomMain (void)
//!
// @vanilla
//
+ // Items respawn at random locations
+ //
+
+ randomparm = M_CheckParm ("-random");
+
+ //!
+ // @vanilla
+ //
// Monsters move faster.
//
diff --git a/src/strife/doomstat.h b/src/strife/doomstat.h
index 1d2d191d..95803c29 100644
--- a/src/strife/doomstat.h
+++ b/src/strife/doomstat.h
@@ -54,6 +54,7 @@
extern boolean nomonsters; // checkparm of -nomonsters
extern boolean respawnparm; // checkparm of -respawn
extern boolean fastparm; // checkparm of -fast
+extern boolean randomparm; // [STRIFE] checkparm of -random
extern boolean flipparm; // [STRIFE] checkparm of -flip
extern boolean devparm; // DEBUG: launched with -devparm
diff --git a/src/strife/p_mobj.c b/src/strife/p_mobj.c
index 53d12f9c..7517b57f 100644
--- a/src/strife/p_mobj.c
+++ b/src/strife/p_mobj.c
@@ -709,13 +709,22 @@ void P_RemoveMobj (mobj_t* mobj)
{
itemrespawnque[iquehead] = mobj->spawnpoint;
itemrespawntime[iquehead] = leveltime + 30*TICRATE; // [STRIFE]
- iquehead = (iquehead+1)&(ITEMQUESIZE-1);
- // [STRIFE] FIXME/TODO: - haleyjd 20110629
+ // [STRIFE] haleyjd 20130915
// -random parameter affects the behavior of respawning items here.
- // However, this requires addition of randomparm to the transmission
- // of variables during netgame initialization, and the netcode is not
- // functional yet - so, I haven't added this yet!
+ if(randomparm && iquehead != iquetail)
+ {
+ short type = itemrespawnque[iquehead].type;
+ short options = itemrespawnque[iquehead].options;
+
+ // swap the type and options of iquehead and iquetail
+ itemrespawnque[iquehead].type = itemrespawnque[iquetail].type;
+ itemrespawnque[iquehead].options = itemrespawnque[iquetail].options;
+ itemrespawnque[iquetail].type = type;
+ itemrespawnque[iquetail].options = options;
+ }
+
+ iquehead = (iquehead+1)&(ITEMQUESIZE-1);
// lose one off the end?
if (iquehead == iquetail)