diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index 1905afa0f2b8ff660c34ec0f4a11b85598a7aae4..0019bc9531f546a9fc6146f5d7213612c1a1b73d 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -1848,7 +1848,7 @@ void D_AddWorld(INT32 mapnum)
 	char buf[MAX_WADPATH+1];
 	char *buf_p = buf;
 
-	CONS_Debug(DBG_GAMELOGIC, "Map change: mapnum=%d\n", mapnum);
+	CONS_Debug(DBG_GAMELOGIC, "New world: mapnum=%d\n", mapnum);
 
 	I_Assert(W_CheckNumForName(mapname) != LUMPERROR);
 
diff --git a/src/g_game.c b/src/g_game.c
index 270561eeee979fbe06a1b07ebde938cbb2842c7c..ed6479f5b1dc8330ec35cd911301a96802efae01 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -5107,29 +5107,32 @@ boolean G_LoadWorld(const char *mapname)
 
 	INT16 mapnum = (INT16)M_MapNumber(mapname[3], mapname[4]); // get xx out of MAPxx
 
-	LUA_HookInt(mapnum, HOOK(MapChange));
-
 	// gamemap changed; we assume that its map header is always valid,
 	// so make it so
 	if(!mapheaderinfo[mapnum-1])
 		P_AllocMapHeader(mapnum-1);
 
+	LUA_HookInt(mapnum, HOOK(MapChange));
+
 	nextmapheader = mapheaderinfo[mapnum-1];
 	worldmapheader = nextmapheader;
 
+	world_t *curworld = world;
+
 	if (!P_LoadWorld(mapnum, false))
 	{
+		P_SetWorld(curworld); // Change world back to the previous one
 		CONS_Alert(CONS_ERROR, "G_LoadWorld: Could not load map '%s'\n", mapname);
 		return false;
 	}
 
+	// Change world back to the previous one
+	P_SetWorld(curworld);
+
 #ifdef PARANOIA
 	Z_CheckHeap(-2);
 #endif
 
-	// change world back to yours, for consistency
-	P_SetWorld(localworld);
-
 	return true;
 }