From 7d1d9d0e88449e9502426fa59b6ddb0457d5a8b1 Mon Sep 17 00:00:00 2001 From: soopercool101 Date: Wed, 20 Sep 2023 20:00:36 -0700 Subject: [PATCH] Fix incorrectly swapped min/max for item spawns --- BrawlLib/SSBB/ResourceNodes/ItmFreqNode.cs | 25 +++++++++++----------- BrawlLib/SSBB/Types/ItmFreq.cs | 4 ++-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/BrawlLib/SSBB/ResourceNodes/ItmFreqNode.cs b/BrawlLib/SSBB/ResourceNodes/ItmFreqNode.cs index 0f4fbb3a5..b3f886698 100644 --- a/BrawlLib/SSBB/ResourceNodes/ItmFreqNode.cs +++ b/BrawlLib/SSBB/ResourceNodes/ItmFreqNode.cs @@ -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(); } } @@ -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) { @@ -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; } diff --git a/BrawlLib/SSBB/Types/ItmFreq.cs b/BrawlLib/SSBB/Types/ItmFreq.cs index 4ff12e1c3..c64819919 100644 --- a/BrawlLib/SSBB/Types/ItmFreq.cs +++ b/BrawlLib/SSBB/Types/ItmFreq.cs @@ -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 {