From 0441e015807e2df4b974d13ca48a135efd5335c1 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 27 Jan 2016 00:11:15 +1100 Subject: [PATCH] Fix /copylvl and /renamelvl. --- Commands/Moderation/CmdRenameLvl.cs | 7 +++++-- Commands/World/CmdCopyLVL.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Commands/Moderation/CmdRenameLvl.cs b/Commands/Moderation/CmdRenameLvl.cs index 64d4361f6..b4aa5f72e 100644 --- a/Commands/Moderation/CmdRenameLvl.cs +++ b/Commands/Moderation/CmdRenameLvl.cs @@ -49,8 +49,11 @@ namespace MCGalaxy.Commands try { File.Move("levels/" + foundLevel.name + ".lvl", "levels/" + newName + ".lvl"); - File.Move("levels/" + foundLevel.name + ".lvl.backup", "levels/" + newName + ".lvl.backup"); - + try + { + File.Move("levels/" + foundLevel.name + ".lvl.backup", "levels/" + newName + ".lvl.backup"); + } catch { } + try { File.Move("levels/level properties/" + foundLevel.name + ".properties", "levels/level properties/" + newName + ".properties"); diff --git a/Commands/World/CmdCopyLVL.cs b/Commands/World/CmdCopyLVL.cs index 1c3590862..d0dac08b5 100644 --- a/Commands/World/CmdCopyLVL.cs +++ b/Commands/World/CmdCopyLVL.cs @@ -59,7 +59,7 @@ namespace MCGalaxy.Commands } try { File.Copy("levels/" + msg1 + ".lvl", "levels/" + msg2 + ".lvl"); - File.Copy("levels/level properties/" + msg1 + ".properties", "levels/level properties/" + msg1 + ".properties", false); + File.Copy("levels/level properties/" + msg1 + ".properties", "levels/level properties/" + msg2 + ".properties", false); if (File.Exists("blockdefs/lvl_" + msg1 + ".json")) File.Copy("blockdefs/lvl_" + msg1 + ".json", "blockdefs/lvl_" + msg2 + ".json"); } catch (System.IO.FileNotFoundException) {