diff --git a/Blocks/Behaviour/WalkthroughBehaviour.cs b/Blocks/Behaviour/WalkthroughBehaviour.cs index 1ed8a37ea..78e23aec0 100644 --- a/Blocks/Behaviour/WalkthroughBehaviour.cs +++ b/Blocks/Behaviour/WalkthroughBehaviour.cs @@ -29,7 +29,7 @@ namespace MCGalaxy.BlockBehaviour { } internal static bool Train(Player p, byte block, ushort x, ushort y, ushort z) { - if (!p.onTrain) p.HandleDeath(Block.train); + if (!p.trainInvincible) p.HandleDeath(Block.train); return true; } diff --git a/Commands/other/CmdRide.cs b/Commands/other/CmdRide.cs index df4228d6b..f9ec6efd1 100644 --- a/Commands/other/CmdRide.cs +++ b/Commands/other/CmdRide.cs @@ -36,6 +36,7 @@ namespace MCGalaxy.Commands { } void DoRide(Player p) { + p.trainInvincible = true; while (p.onTrain) { Thread.Sleep(10); ushort x = (ushort)(p.pos[0] / 32); @@ -80,10 +81,10 @@ namespace MCGalaxy.Commands { ; } + p.trainGrab = false; Player.Message(p, "Dismounted"); Thread.Sleep(1000); - p.trainGrab = false; - p.onTrain = false; + p.trainInvincible = false; } public override void Help(Player p) { diff --git a/Player/Group/GroupProperties.cs b/Player/Group/GroupProperties.cs index debce96f8..af5abd09b 100644 --- a/Player/Group/GroupProperties.cs +++ b/Player/Group/GroupProperties.cs @@ -115,7 +115,7 @@ namespace MCGalaxy { /// Save givenList group /// The list of groups to save public static void SaveGroups(List givenList) { - using (CP437Writer w = new CP437Writer("properties/ranks.properties")) { + using (CP437Writer w = new CP437Writer(filename)) { w.WriteLine("#Version 3"); w.WriteLine("#RankName = string"); w.WriteLine("#\tThe name of the rank, use capitalization."); diff --git a/Player/Player.Fields.cs b/Player/Player.Fields.cs index 7a8c6f87c..f4e0ca678 100644 --- a/Player/Player.Fields.cs +++ b/Player/Player.Fields.cs @@ -136,7 +136,7 @@ namespace MCGalaxy { public string storedMessage = ""; public bool trainGrab = false; - public bool onTrain = false; + public bool onTrain = false, trainInvincible = false; public bool allowTnt = true; public bool frozen = false; diff --git a/Player/Player.Handlers.cs b/Player/Player.Handlers.cs index 6a65e89b1..44756e854 100644 --- a/Player/Player.Handlers.cs +++ b/Player/Player.Handlers.cs @@ -396,7 +396,7 @@ return; if (!immediate && lastDeath.AddSeconds(2) > DateTime.UtcNow) return; if (!level.Killer || invincible || hidden) return; - onTrain = false; trainGrab = false; + onTrain = false; trainInvincible = false; trainGrab = false; ushort x = (ushort)(pos[0] / 32), y = (ushort)(pos[1] / 32), z = (ushort)(pos[2] / 32); string deathMsg = Block.Props[b].DeathMessage; if (deathMsg != null) Chat.GlobalChatLevel(this, String.Format(deathMsg, ColoredName), false);