Fix joining museums after joining a world not causing world to auto-unload, partially addresses #316

This commit is contained in:
UnknownShadow200 2017-05-10 14:12:11 +10:00
parent bfd4042f84
commit 1c3992cbb0
3 changed files with 6 additions and 14 deletions

View File

@ -63,18 +63,9 @@ namespace MCGalaxy.Commands.World {
lvl.MapName = mapName;
SetLevelProps(lvl);
Level.LoadMetadata(lvl);
if (!lvl.CanJoin(p)) 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);
if (!PlayerActions.ChangeMap(p, lvl)) return;
p.ClearBlockchange();
Chat.MessageGlobal(p, p.ColoredName + " %Swent to the " + lvl.name, false, true);
}
static void SetLevelProps(Level lvl) {

View File

@ -112,7 +112,8 @@ namespace MCGalaxy {
CheckGamesJoin(p, 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);
}
return true;