diff options
author | James Haley | 2013-09-16 00:29:44 +0000 |
---|---|---|
committer | James Haley | 2013-09-16 00:29:44 +0000 |
commit | 83d832ee4e6aabcdeacd282e73dd12ba81367e88 (patch) | |
tree | fe0f21468fad218c738c0aba0d387662a771f94a | |
parent | e4e5387b31550cd771b0ae77db18a2914a82688a (diff) | |
download | chocolate-doom-83d832ee4e6aabcdeacd282e73dd12ba81367e88.tar.gz chocolate-doom-83d832ee4e6aabcdeacd282e73dd12ba81367e88.tar.bz2 chocolate-doom-83d832ee4e6aabcdeacd282e73dd12ba81367e88.zip |
Support for the -random parameter. Needs netcode support (passing the
ball to fraggle).
Subversion-branch: /branches/v2-branch
Subversion-revision: 2657
-rw-r--r-- | src/strife/d_main.c | 9 | ||||
-rw-r--r-- | src/strife/doomstat.h | 1 | ||||
-rw-r--r-- | src/strife/p_mobj.c | 19 |
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) |