Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIrata committed Sep 29, 2016
1 parent 97e330b commit 9ffde71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
16 changes: 5 additions & 11 deletions TerrariaUSaveEditor/Helper/ItemHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,21 @@ private static bool GotAllSlots(SlotType slotType, int currentSlot)
switch (slotType)
{
case SlotType.Bar:
return currentSlot == 10 ? true : false;
return currentSlot == 10;
case SlotType.Inv:
return currentSlot == 30 ? true : false;
return currentSlot == 30;
case SlotType.Ammo:
return currentSlot == 4 ? true : false;
return currentSlot == 4;
case SlotType.Money:
return currentSlot == 4 ? true : false;
return currentSlot == 4;
default:
throw new ArgumentException("Invalid SlotType");
}
}

private static bool IsEmptySlot(byte[] idData)
{
if (idData[0] == 0 &&
idData[1] == 0)
{
return true;
}

return false;
return idData[0] == 0 && idData[1] == 0;
}

private static int GetIDFromBytes(byte[] idData)
Expand Down
5 changes: 1 addition & 4 deletions TerrariaUSaveEditor/ItemEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ public ItemEditor()

private void BtnSave_Click(object sender, EventArgs e)
{
int prefixID = 0;
int.TryParse(this.CbPrefix.SelectedText, out prefixID);

this.invData.Amount = ushort.Parse(this.NudAmount.Value.ToString());
this.invData.Prefix = prefixID;
this.invData.Prefix = this.CbPrefix.SelectedIndex;
this.invData.Item = new ItemData(ushort.Parse(this.NudItemId.Value.ToString()), this.TxtItemName.Text);

var itemEditorSavedEventArgs = new ItemEditorSavedEventArgs();
Expand Down

0 comments on commit 9ffde71

Please sign in to comment.