From e14191a72281a0a1d90bf8ced4b22e9b544e1a79 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 16 May 2010 19:12:03 +0000 Subject: [PATCH] workaround some map voting/spawning bugs in coop-edit git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4883 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/server.h | 2 +- source/src/serveractions.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/src/server.h b/source/src/server.h index 4993125b..af5e4be4 100644 --- a/source/src/server.h +++ b/source/src/server.h @@ -242,7 +242,7 @@ struct client // server side version of "dynent" type events.setsize(0); overflow = 0; timesync = false; - isonrightmap = false; + isonrightmap = m_coop; spawnperm = SP_WRONGMAP; spawnpermsent = servmillis; if(!getmap) diff --git a/source/src/serveractions.h b/source/src/serveractions.h index 1b040719..691ed1c6 100644 --- a/source/src/serveractions.h +++ b/source/src/serveractions.h @@ -49,7 +49,7 @@ struct mapaction : serveraction bool notify = valid_client(caller); int maploc = MAP_NOTFOUND; mapstats *ms = map[0] ? getservermapstats(map, false, &maploc) : NULL; - mapok = ms != NULL; + mapok = mode == GMODE_COOPEDIT || ms != NULL; if(!mapok) { if(notify) sendservmsg("the server does not have this map", caller); @@ -59,8 +59,8 @@ struct mapaction : serveraction if(mode == GMODE_COOPEDIT && !strchr(scl.voteperm, 'e')) role = CR_ADMIN; bool romap = mode == GMODE_COOPEDIT && readonlymap(maploc); int smode = mode; // 'borrow' the mode macros by replacing a global by a local var - bool spawns = (m_teammode && !m_ktf) ? ms->hasteamspawns : ms->hasffaspawns; - bool flags = m_flags && !m_htf ? ms->hasflags : true; + bool spawns = mode == GMODE_COOPEDIT || (m_teammode && !m_ktf ? ms->hasteamspawns : ms->hasffaspawns); + bool flags = mode != GMODE_COOPEDIT && m_flags && !m_htf ? ms->hasflags : true; if(!spawns || !flags || romap) { // unsupported mode if(strchr(scl.voteperm, 'P')) role = CR_ADMIN;