mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-27 21:51:00 +00:00
- Extended map, recordmap, and open commands to accept "dm/coop" as an extra parameter - to open maps in multiplayer mode with the requested ruleset.
This commit is contained in:
parent
6e0defdc69
commit
f72ebe6768
3 changed files with 41 additions and 4 deletions
|
@ -71,6 +71,9 @@ extern bool netgame;
|
||||||
// Bot game? Like netgame, but doesn't involve network communication.
|
// Bot game? Like netgame, but doesn't involve network communication.
|
||||||
extern bool multiplayer;
|
extern bool multiplayer;
|
||||||
|
|
||||||
|
// [SP] MPMap implementation - invokes fake multiplayer without bots
|
||||||
|
extern bool multiplayernext;
|
||||||
|
|
||||||
// Flag: true only if started as net deathmatch.
|
// Flag: true only if started as net deathmatch.
|
||||||
EXTERN_CVAR (Int, deathmatch)
|
EXTERN_CVAR (Int, deathmatch)
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,7 @@ bool viewactive;
|
||||||
|
|
||||||
bool netgame; // only true if packets are broadcast
|
bool netgame; // only true if packets are broadcast
|
||||||
bool multiplayer;
|
bool multiplayer;
|
||||||
|
bool multiplayernext = false; // [SP] MPMap implementation
|
||||||
player_t players[MAXPLAYERS];
|
player_t players[MAXPLAYERS];
|
||||||
bool playeringame[MAXPLAYERS];
|
bool playeringame[MAXPLAYERS];
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,8 @@
|
||||||
|
|
||||||
#include "g_hub.h"
|
#include "g_hub.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
void STAT_StartNewGame(const char *lev);
|
void STAT_StartNewGame(const char *lev);
|
||||||
void STAT_ChangeLevel(const char *newl);
|
void STAT_ChangeLevel(const char *newl);
|
||||||
|
|
||||||
|
@ -181,6 +183,16 @@ CCMD (map)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (argv.argc() > 2 && strcmp(argv[2], "coop") == 0)
|
||||||
|
{
|
||||||
|
deathmatch = false;
|
||||||
|
multiplayernext = true;
|
||||||
|
}
|
||||||
|
else if (argv.argc() > 2 && strcmp(argv[2], "dm") == 0)
|
||||||
|
{
|
||||||
|
deathmatch = true;
|
||||||
|
multiplayernext = true;
|
||||||
|
}
|
||||||
G_DeferedInitNew (argv[1]);
|
G_DeferedInitNew (argv[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,7 +204,7 @@ CCMD (map)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Printf ("Usage: map <map name>\n");
|
Printf ("Usage: map <map name> [coop|dm]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,6 +230,16 @@ CCMD(recordmap)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (argv.argc() > 3 && strcmp(argv[3], "coop") == 0)
|
||||||
|
{
|
||||||
|
deathmatch = false;
|
||||||
|
multiplayernext = true;
|
||||||
|
}
|
||||||
|
else if (argv.argc() > 3 && strcmp(argv[3], "dm") == 0)
|
||||||
|
{
|
||||||
|
deathmatch = true;
|
||||||
|
multiplayernext = true;
|
||||||
|
}
|
||||||
G_DeferedInitNew(argv[2]);
|
G_DeferedInitNew(argv[2]);
|
||||||
gameaction = ga_recordgame;
|
gameaction = ga_recordgame;
|
||||||
newdemoname = argv[1];
|
newdemoname = argv[1];
|
||||||
|
@ -232,7 +254,7 @@ CCMD(recordmap)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Printf("Usage: recordmap <filename> <map name>\n");
|
Printf("Usage: recordmap <filename> <map name> [coop|dm]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,13 +280,23 @@ CCMD (open)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (argv.argc() > 2 && strcmp(argv[2], "coop") == 0)
|
||||||
|
{
|
||||||
|
deathmatch = false;
|
||||||
|
multiplayernext = true;
|
||||||
|
}
|
||||||
|
else if (argv.argc() > 2 && strcmp(argv[2], "dm") == 0)
|
||||||
|
{
|
||||||
|
deathmatch = true;
|
||||||
|
multiplayernext = true;
|
||||||
|
}
|
||||||
gameaction = ga_newgame2;
|
gameaction = ga_newgame2;
|
||||||
d_skill = -1;
|
d_skill = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Printf ("Usage: open <map file>\n");
|
Printf ("Usage: open <map file> [coop|dm]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +325,8 @@ void G_NewInit ()
|
||||||
G_ClearSnapshots ();
|
G_ClearSnapshots ();
|
||||||
ST_SetNeedRefresh();
|
ST_SetNeedRefresh();
|
||||||
netgame = false;
|
netgame = false;
|
||||||
multiplayer = false;
|
multiplayer = multiplayernext;
|
||||||
|
multiplayernext = false;
|
||||||
if (demoplayback)
|
if (demoplayback)
|
||||||
{
|
{
|
||||||
C_RestoreCVars ();
|
C_RestoreCVars ();
|
||||||
|
|
Loading…
Reference in a new issue