Remove unnecessary overload

Not a fix, just cleanup.
Extract pokedata fetch so it's not done every area.
This commit is contained in:
Kurt
2025-07-04 22:41:43 -05:00
parent 442f253984
commit de3aa6ea5d
2 changed files with 5 additions and 6 deletions

View File

@@ -13,9 +13,6 @@ public static class EncounterDumperSV
private const float tolY = 30f;
private const float tolZ = 30f;
public static bool IsContainedBy<T>(T collider, LocationPointDetail point) where T : IContainsV3f
=> collider.ContainsPoint(point.X, point.Y, point.Z, tolX, tolY, tolZ);
public static bool IsContainedBy<T>(T collider, PackedVec3f point) where T : IContainsV3f
=> collider.ContainsPoint(point.X, point.Y, point.Z, tolX, tolY, tolZ);

View File

@@ -15,7 +15,8 @@ public static void DumpSlots(IFileInternal rom, EncounterDumpConfigSV config, Pa
var db = new LocationDatabase();
// Process all field indices
foreach (var index in EncounterDumperSV.AllMaps) ProcessAreas(index, scene, db, spawns, config.PlaceNameMap);
foreach (var index in EncounterDumperSV.AllMaps)
ProcessAreas(index, scene, db, spawns, config.PlaceNameMap);
// Each area and their local / crossover points have been aggregated.
// Integrate the points' slots into a single list, and consolidate entries with same level ranges to as few objects as possible.
@@ -60,6 +61,7 @@ private static void ProcessAreas(PaldeaFieldIndex fieldIndex, PaldeaSceneModel s
var areaNames = scene.AreaNames[(int)fieldIndex];
var areas = scene.AreaInfos[(int)fieldIndex];
var types = scene.PaldeaType[(int)fieldIndex];
var pd = map.GetPokeData(fieldIndex);
for (var i = areaNames.Count - 1; i >= 0; i--)
{
var areaName = areaNames[i];
@@ -85,7 +87,7 @@ private static void ProcessAreas(PaldeaFieldIndex fieldIndex, PaldeaSceneModel s
var type = types[areaName];
var points = map.GetPoints(fieldIndex, type);
storage.LoadPoints(points, collider, areaInfo.ActualMinLevel, areaInfo.ActualMaxLevel, areaInfo.AdjustEncLv);
storage.GetEncounters(map.GetPokeData(fieldIndex), scene);
storage.GetEncounters(pd, scene);
}
// Add in the locations that each point can be activated, that are not the current area.
@@ -183,7 +185,7 @@ private static void ProcessAreas(PaldeaFieldIndex fieldIndex, PaldeaSceneModel s
foreach (var point in cross.Local)
{
// If the crossover point is close enough to the current area's collider, add it to the current area's list of crossover points.
if (EncounterDumperSV.IsContainedBy(collider, point))
if (EncounterDumperSV.IsContainedBy(collider, point.Point.Position))
storage.Nearby.Add(point);
}
}