mirror of
https://github.com/tribufu/ServerGridEditor
synced 2026-05-18 09:35:49 +00:00
Instinct: EditIsland crash fix
This commit is contained in:
parent
c6c2338443
commit
8b2900fa6b
2 changed files with 7 additions and 7 deletions
Binary file not shown.
|
|
@ -215,7 +215,7 @@ namespace ServerGridEditor
|
||||||
editedIsland.imagePath = newImgPath;
|
editedIsland.imagePath = newImgPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modNameTxtBox.Text != editedIsland.modDir)
|
if (editedIsland.modDir != null && editedIsland.modDir != null && modNameTxtBox.Text != editedIsland.modDir)
|
||||||
{
|
{
|
||||||
//Mod dir changed
|
//Mod dir changed
|
||||||
if (!string.IsNullOrWhiteSpace(modNameTxtBox.Text))
|
if (!string.IsNullOrWhiteSpace(modNameTxtBox.Text))
|
||||||
|
|
@ -246,19 +246,19 @@ namespace ServerGridEditor
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
editedIsland.InvalidateImage();
|
editedIsland.InvalidateImage();
|
||||||
string newImgPath = MainForm.imgsDir + "/" + editedIsland.name + "_img.jpg";
|
string newImgPath = MainForm.imgsDir + "/" + editedIsland.name + "_img.jpg";
|
||||||
if (File.Exists(newImgPath))
|
if (File.Exists(newImgPath))
|
||||||
File.Delete(newImgPath);
|
File.Delete(newImgPath);
|
||||||
File.Move(editedIsland.imagePath, newImgPath);
|
File.Move(editedIsland.imagePath, newImgPath);
|
||||||
|
|
||||||
islandRemovedFromMod = editedIsland.modDir;
|
islandRemovedFromMod = editedIsland.modDir;
|
||||||
editedIsland.modDir = null;
|
editedIsland.modDir = null;
|
||||||
|
|
||||||
if (pictureBox1.ImageLocation == editedIsland.imagePath)
|
if (pictureBox1.ImageLocation == editedIsland.imagePath)
|
||||||
pictureBox1.ImageLocation = newImgPath;
|
pictureBox1.ImageLocation = newImgPath;
|
||||||
|
|
||||||
editedIsland.imagePath = newImgPath;
|
editedIsland.imagePath = newImgPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editedIsland.x = x;
|
editedIsland.x = x;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue