Fix fall damage not killing when falling from non full block, fix changing map MOTD not re-sending motd, fixes #471

This commit is contained in:
UnknownShadow200 2017-09-21 13:18:00 +10:00
parent 58cbef023e
commit 3caa6bde36
2 changed files with 11 additions and 4 deletions

View File

@ -77,8 +77,15 @@ namespace MCGalaxy {
Player[] players = PlayerInfo.Online.Items;
foreach (Player pl in players) {
if (pl.level != lvl || !pl.HasCpeExt(CpeExt.HackControl)) continue;
pl.Send(Hacks.MakeHackControl(pl));
// Unfortunately, some clients will freeze or crash if we send a MOTD packet,
// but don't follow it up by a new map. Thus, we have to use the ugly approach
// of only sending to whitelisted clients.
if (pl.appName != null && pl.appName.CaselessStarts("classicalsharp")) {
pl.SendMapMotd();
} else {
LevelActions.ReloadMap(p, pl, false);
if (pl.HasCpeExt(CpeExt.HackControl)) pl.Send(Hacks.MakeHackControl(pl));
}
}
}

View File

@ -69,8 +69,8 @@ namespace MCGalaxy.Blocks.Physics {
allGas = allGas && collide == CollideType.WalkThrough;
if (!CollideType.IsSolid(collide)) continue;
int fallHeight = (p.startFallY - bb.Min.Y) / 32;
if (fallHeight > p.level.Config.FallHeight)
int fallHeight = p.startFallY - bb.Min.Y;
if (fallHeight > p.level.Config.FallHeight * 32)
p.HandleDeath(ExtBlock.Air, null, false, true);
p.startFallY = -1;