Fix new world generator breaking with non-default instance paths #286

This commit is contained in:
Brant Martin
2019-02-25 12:55:04 -05:00
parent e37357aea5
commit 642186678e

View File

@@ -74,8 +74,9 @@ namespace Torch.Server
private void ButtonBase_OnClick(object sender, RoutedEventArgs e) private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{ {
string worldName = string.IsNullOrEmpty(WorldName.Text) ? _currentItem.Name : WorldName.Text; string worldName = string.IsNullOrEmpty(WorldName.Text) ? _currentItem.Name : WorldName.Text;
var worldPath = Path.Combine("Instance", "Saves", worldName);
var checkpoint= _currentItem.Checkpoint; var worldPath = Path.Combine(TorchBase.Instance.Config.InstancePath, "Saves", worldName);
var checkpoint = _currentItem.Checkpoint;
if (Directory.Exists(worldPath)) if (Directory.Exists(worldPath))
{ {
MessageBox.Show("World already exists with that name."); MessageBox.Show("World already exists with that name.");