@@ -1864,7 +1864,11 @@ void setMarioStatsValue(uint32_t currentMenuOption)
1864
1864
case SPECIAL_MOVES:
1865
1865
case STAR_POWER:
1866
1866
{
1867
- ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1867
+ // Only set the flag for clearing the cache if not in a battle
1868
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
1869
+ {
1870
+ ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1871
+ }
1868
1872
break ;
1869
1873
}
1870
1874
case BP:
@@ -1886,7 +1890,11 @@ void setMarioStatsValue(uint32_t currentMenuOption)
1886
1890
*reinterpret_cast <int16_t *>(PouchPtr + 0x70 ) = MaxHP;
1887
1891
}
1888
1892
1889
- ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1893
+ // Only set the flag for clearing the cache if not in a battle
1894
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
1895
+ {
1896
+ ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1897
+ }
1890
1898
break ;
1891
1899
}
1892
1900
case MARIO_MAX_FP:
@@ -1902,7 +1910,11 @@ void setMarioStatsValue(uint32_t currentMenuOption)
1902
1910
*reinterpret_cast <int16_t *>(PouchPtr + 0x74 ) = MaxFP;
1903
1911
}
1904
1912
1905
- ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1913
+ // Only set the flag for clearing the cache if not in a battle
1914
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
1915
+ {
1916
+ ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1917
+ }
1906
1918
break ;
1907
1919
}
1908
1920
case MARIO_LEVEL:
@@ -1917,7 +1929,12 @@ void setMarioStatsValue(uint32_t currentMenuOption)
1917
1929
}
1918
1930
1919
1931
*reinterpret_cast<int16_t *>(PouchPtr + 0x88) = NewRank;*/
1920
- ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1932
+
1933
+ // Only set the flag for clearing the cache if not in a battle
1934
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
1935
+ {
1936
+ ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1937
+ }
1921
1938
break ;
1922
1939
}
1923
1940
case MAX_STAR_POWER:
@@ -1931,7 +1948,11 @@ void setMarioStatsValue(uint32_t currentMenuOption)
1931
1948
*reinterpret_cast <int16_t *>(PouchPtr + 0x7A ) = MaxSP;
1932
1949
}
1933
1950
1934
- ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1951
+ // Only set the flag for clearing the cache if not in a battle
1952
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
1953
+ {
1954
+ ClearCacheForBattles.MarioStatsShouldBeCleared = true ;
1955
+ }
1935
1956
break ;
1936
1957
}
1937
1958
default :
@@ -1954,7 +1975,11 @@ void setPartnerStatsValue(uint32_t currentMenuOption)
1954
1975
*reinterpret_cast <int16_t *>(PartnerEnabledAddress + 0x6 ) =
1955
1976
static_cast <int16_t >(tempMenuSecondaryValue);
1956
1977
1957
- ClearCacheForBattles.PartnerStatsShouldBeCleared = true ;
1978
+ // Only set the flag for clearing the cache if not in a battle
1979
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
1980
+ {
1981
+ ClearCacheForBattles.PartnerStatsShouldBeCleared = true ;
1982
+ }
1958
1983
break ;
1959
1984
}
1960
1985
case PARTNER_MAX_HP:
@@ -1966,7 +1991,11 @@ void setPartnerStatsValue(uint32_t currentMenuOption)
1966
1991
*reinterpret_cast <int16_t *>(PartnerEnabledAddress + 0x4 ) =
1967
1992
static_cast <int16_t >(tempMenuSecondaryValue);
1968
1993
1969
- ClearCacheForBattles.PartnerStatsShouldBeCleared = true ;
1994
+ // Only set the flag for clearing the cache if not in a battle
1995
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
1996
+ {
1997
+ ClearCacheForBattles.PartnerStatsShouldBeCleared = true ;
1998
+ }
1970
1999
break ;
1971
2000
}
1972
2001
case PARTNER_RANK:
@@ -1978,7 +2007,15 @@ void setPartnerStatsValue(uint32_t currentMenuOption)
1978
2007
*reinterpret_cast <int16_t *>(PartnerEnabledAddress + 0xC ) =
1979
2008
static_cast <int16_t >(tempMenuSecondaryValue);
1980
2009
1981
- ClearCacheForBattles.PartnerStatsShouldBeCleared = true ;
2010
+ // Set the rank used to verify the partner's stats when equipping/unequipping badges
2011
+ *reinterpret_cast <int16_t *>(PartnerEnabledAddress + 0x8 ) =
2012
+ static_cast <int16_t >(tempMenuSecondaryValue);
2013
+
2014
+ // Only set the flag for clearing the cache if not in a battle
2015
+ if (!checkForSpecificSeq (ttyd::seqdrv::SeqIndex::kBattle ))
2016
+ {
2017
+ ClearCacheForBattles.PartnerStatsShouldBeCleared = true ;
2018
+ }
1982
2019
break ;
1983
2020
}
1984
2021
default :
0 commit comments