mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Fix joining museums after joining a world not causing world to auto-unload, partially addresses #316
This commit is contained in:
parent
bfd4042f84
commit
1c3992cbb0
@ -62,19 +62,10 @@ namespace MCGalaxy.Commands.World {
|
|||||||
Level lvl = IMapImporter.Formats[0].Read(path, name, false);
|
Level lvl = IMapImporter.Formats[0].Read(path, name, false);
|
||||||
lvl.MapName = mapName;
|
lvl.MapName = mapName;
|
||||||
SetLevelProps(lvl);
|
SetLevelProps(lvl);
|
||||||
Level.LoadMetadata(lvl);
|
Level.LoadMetadata(lvl);
|
||||||
if (!lvl.CanJoin(p)) return;
|
|
||||||
|
if (!PlayerActions.ChangeMap(p, lvl)) return;
|
||||||
p.Loading = true;
|
|
||||||
Entities.DespawnEntities(p);
|
|
||||||
Level oldLevel = p.level;
|
|
||||||
p.level = lvl;
|
|
||||||
if (!p.SendRawMap(oldLevel, lvl)) return;
|
|
||||||
|
|
||||||
Entities.GlobalSpawn(p, lvl.SpawnPos, lvl.SpawnRot, true);
|
|
||||||
p.ClearBlockchange();
|
p.ClearBlockchange();
|
||||||
|
|
||||||
Chat.MessageGlobal(p, p.ColoredName + " %Swent to the " + lvl.name, false, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetLevelProps(Level lvl) {
|
static void SetLevelProps(Level lvl) {
|
||||||
|
@ -97,7 +97,7 @@ namespace MCGalaxy {
|
|||||||
PlayerInfo.Online.Add(this);
|
PlayerInfo.Online.Add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMap(null);
|
SendMap(null);
|
||||||
if (disconnected) return;
|
if (disconnected) return;
|
||||||
loggedIn = true;
|
loggedIn = true;
|
||||||
connections.Remove(this);
|
connections.Remove(this);
|
||||||
|
@ -112,7 +112,8 @@ namespace MCGalaxy {
|
|||||||
CheckGamesJoin(p, oldLevel);
|
CheckGamesJoin(p, oldLevel);
|
||||||
|
|
||||||
if (p.level.ShouldShowJoinMessage(oldLevel)) {
|
if (p.level.ShouldShowJoinMessage(oldLevel)) {
|
||||||
Chat.MessageGlobal(p, p.ColoredName + " %Swent to " + lvl.ColoredName, false, true);
|
string msg = p.level.IsMuseum ? "%Swent to the " : "%Swent to ";
|
||||||
|
Chat.MessageGlobal(p, p.ColoredName + " %Swent " + lvl.ColoredName, false, true);
|
||||||
Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name);
|
Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user