mirror of
https://github.com/kwsch/pkNX.git
synced 2026-08-20 09:24:06 -05:00
Remove unnecessary overload
Not a fix, just cleanup. Extract pokedata fetch so it's not done every area.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user