mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Fix issue with /main [mapname] causing mapname to be loaded twice if [mapname] was already a loaded map.
This commit is contained in:
parent
e6f82e09d7
commit
f2b60e488e
@ -40,12 +40,22 @@ namespace MCGalaxy.Commands.World {
|
||||
|
||||
string map = LevelInfo.FindMapMatches(p, message);
|
||||
if (map == null) return;
|
||||
Level oldMain = Server.mainLevel;
|
||||
|
||||
Server.level = map;
|
||||
Server.mainLevel = Level.Load(map);
|
||||
Level match = LevelInfo.FindExact(map);
|
||||
if (match != null) {
|
||||
Server.mainLevel = match;
|
||||
} else {
|
||||
Server.mainLevel = Level.Load(map);
|
||||
LevelInfo.Loaded.Add(Server.mainLevel);
|
||||
}
|
||||
|
||||
oldMain.unload = true;
|
||||
Server.mainLevel.unload = false;
|
||||
SrvProperties.Save();
|
||||
Player.Message(p, "Set main level to \"{0}\"", map);
|
||||
Server.level = map;
|
||||
|
||||
SrvProperties.Save();
|
||||
Player.Message(p, "Set main level to \"{0}\"", map);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user