From af5902b370457921d5f7b266c6c04c5ef3da1f6b Mon Sep 17 00:00:00 2001 From: flowtron Date: Sun, 10 Oct 2010 13:34:58 +0000 Subject: [PATCH] revert bogus and really fix stuck-in-editmode bug git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5741 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 2 +- source/src/clients2c.cpp | 1 + source/src/editing.cpp | 7 +------ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 9ffaf097..27b75e54 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -574,7 +574,7 @@ void spawnplayer(playerent *d) { d->respawn(); d->spawnstate(gamemode); - d->state = CS_ALIVE;//TESTING:avoid being stuck in editmode// (d==player1 && editmode) ? CS_EDITING : CS_ALIVE; + d->state = (d==player1 && editmode) ? CS_EDITING : CS_ALIVE; findplayerstart(d); } diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 8168b93c..7083f350 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -37,6 +37,7 @@ bool changemapserv(char *name, int mode, int download, int revision) // f if(!name[0] || !load_world(name)) empty_world(0, true); return true; } + else if(player1->state==CS_EDITING) { /*conoutf("SANITY drop from EDITING");*/ toggleedit(true); } // fix stuck-in-editmode bug bool loaded = load_world(name); if(download > 0) { diff --git a/source/src/editing.cpp b/source/src/editing.cpp index a819edac..5d22cb79 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -35,18 +35,13 @@ VAR(editing, 1, 0, 0); void toggleedit(bool force) { if(player1->state==CS_DEAD) return; // do not allow dead players to edit to avoid state confusion - if(!force && !editmode && !allowedittoggle()) - { - if(player1->state==CS_EDITING) player1->state = CS_ALIVE; //TESTING: avoid being stuck in editmode - return; // not in most multiplayer modes - } + if(!force && !editmode && !allowedittoggle()) return; // not in most multiplayer modes if(!(editmode = !editmode)) { entinmap(player1); // find spawn closest to current floating pos } else { - //player1->health = 100; // illusion only (client-side) and unwanted anyway (bug found by grenadier) //put call to clear/restart gamemode player1->attacking = false; }