mirror of
https://github.com/kwsch/NLSE.git
synced 2026-09-07 10:55:17 -05:00
prevent writing null items
This commit is contained in:
@@ -388,6 +388,7 @@ private void clickTown(object sender, MouseEventArgs e)
|
||||
choiceTownItem = TownItems[index]; // replace this with updating the item view
|
||||
else // Write
|
||||
{
|
||||
if (choiceTownItem == null) return;
|
||||
TownItems[index] = choiceTownItem;
|
||||
int zX = (X - 16) / 16;
|
||||
int zY = (Y - 16) / 16;
|
||||
@@ -411,7 +412,8 @@ private void clickIsland(object sender, MouseEventArgs e)
|
||||
choiceIslandItem = IslandItems[index]; // replace this with updating the item view
|
||||
else // Write
|
||||
{
|
||||
IslandItems[index] = choiceTownItem;
|
||||
if (choiceIslandItem == null) return;
|
||||
IslandItems[index] = choiceIslandItem;
|
||||
int zX = (X - 16) / 16;
|
||||
int zY = (Y - 16) / 16;
|
||||
int zAcre = zX + zY * 2;
|
||||
@@ -419,8 +421,8 @@ private void clickIsland(object sender, MouseEventArgs e)
|
||||
}
|
||||
}
|
||||
|
||||
private Item choiceTownItem;
|
||||
private Item choiceIslandItem;
|
||||
private Item choiceTownItem = new Item(new byte[] {0xFE, 0x7F, 0, 0});
|
||||
private Item choiceIslandItem = new Item(new byte[] {0xFE, 0x7F, 0, 0});
|
||||
private int getItemIndex(int X, int Y, int width)
|
||||
{
|
||||
int zX = (X - 16) / 16;
|
||||
|
||||
Reference in New Issue
Block a user