mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 05:06:35 -05:00
Auto-Search lvlmoves: Emerald
Emerald didn't work because in Emerald, there's a false pointer at the start of one of the PLM runs. This is easy to correct: just add Pointer as a special case, since it is the only type of run that doesn't require having a name or pointer to it.
This commit is contained in:
@@ -804,7 +804,10 @@ namespace HavenSoft.HexManiac.Core.Models {
|
||||
var anchorRun = runs[index];
|
||||
var newAnchorRun = anchorRun.RemoveSource(start);
|
||||
changeToken.RemoveRun(anchorRun);
|
||||
if (newAnchorRun.PointerSources.Count == 0 && !anchorForAddress.ContainsKey(newAnchorRun.Start)) {
|
||||
|
||||
// the only run that is allowed to exist with nothing pointing to it and no name is a pointer run.
|
||||
// if it's any other kind of run with no name and no pointers to it, remove it.
|
||||
if (newAnchorRun.PointerSources.Count == 0 && !anchorForAddress.ContainsKey(newAnchorRun.Start) && !(newAnchorRun is PointerRun)) {
|
||||
runs.RemoveAt(index);
|
||||
} else {
|
||||
runs[index] = newAnchorRun;
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace HavenSoft.HexManiac.Core.Models.Runs {
|
||||
if (destination == Pointer.NULL) return true;
|
||||
var run = owner.GetNextAnchor(destination);
|
||||
if (run.Start < destination) return false;
|
||||
if (run.Start > destination || (run.Start == destination && run is NoInfoRun)) {
|
||||
if (run.Start > destination || (run.Start == destination && (run is NoInfoRun || run is PointerRun))) {
|
||||
// hard case: no format found, so check the data
|
||||
if (InnerFormat == PCSRun.SharedFormatString) {
|
||||
var length = PCSString.ReadString(owner, destination, true);
|
||||
|
||||
@@ -156,6 +156,17 @@ namespace HavenSoft.HexManiac.Tests {
|
||||
for (int i = 0; i < compareSet.Length; i++) Assert.Equal(compareSet[i], firstPokemonStats[i]);
|
||||
}
|
||||
|
||||
[SkippableTheory]
|
||||
[MemberData(nameof(PokemonGames))]
|
||||
public void LvlUpMovesAreFound(string game) {
|
||||
var model = LoadModel(game);
|
||||
var noChange = new NoDataChangeDeltaModel();
|
||||
|
||||
var address = model.GetAddressFromAnchor(noChange, -1, "lvlmoves");
|
||||
var run = (ArrayRun)model.GetNextAnchor(address);
|
||||
Assert.NotNull(run);
|
||||
}
|
||||
|
||||
[SkippableTheory]
|
||||
[MemberData(nameof(PokemonGames))]
|
||||
public void MoveDataFound(string game) {
|
||||
|
||||
Reference in New Issue
Block a user