Skip to content

Commit

Permalink
Fix incorrectly swapped min/max for item spawns
Browse files Browse the repository at this point in the history
  • Loading branch information
soopercool101 committed Sep 21, 2023
1 parent e1ef513 commit 7d1d9d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
25 changes: 12 additions & 13 deletions BrawlLib/SSBB/ResourceNodes/ItmFreqNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,31 +390,30 @@ public string Frequency
}
}

private short _action;
private short _min;

[DisplayName("Minimum to Spawn")]
[Category("Item")]
public short Action
public short Minimum
{
get => _action;
get => _min;
set
{
_action = value;
_min = value;
SignalPropertyChange();
}
}

private short _subaction;
private short _max;

[DisplayName("Maximum to Spawn")]
[Category("Item")]
[Description("Possible the spawning subaction of the item.")]
public short Subaction
public short Maximum
{
get => _subaction;
get => _max;
set
{
_subaction = value;
_max = value;
SignalPropertyChange();
}
}
Expand All @@ -425,8 +424,8 @@ public override bool OnInitialize()
_id = Header->_ID;
_costumeID = Header->_subItem;
_frequency = Header->_frequency;
_action = Header->_action;
_subaction = Header->_subaction;
_min = Header->_min;
_max = Header->_max;

if (_name == null)
{
Expand All @@ -440,10 +439,10 @@ public override void OnRebuild(VoidPtr address, int length, bool force)
{
ItmFreqEntry* _header = (ItmFreqEntry*) address;
*_header = new ItmFreqEntry();
_header->_action = _action;
_header->_max = _max;
_header->_frequency = _frequency;
_header->_ID = _id;
_header->_subaction = _subaction;
_header->_min = _min;
_header->_subItem = _costumeID;
}

Expand Down
4 changes: 2 additions & 2 deletions BrawlLib/SSBB/Types/ItmFreq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public unsafe struct ItmFreqEntry
public bint _ID;
public bint _subItem;
public bfloat _frequency;
public bshort _subaction;
public bshort _action;
public bshort _min;
public bshort _max;

private VoidPtr Address
{
Expand Down

0 comments on commit 7d1d9d0

Please sign in to comment.