Fix #5713: FindClosestShipDepot only considers depots that are actually reachable (#11768)

This commit is contained in:
Kuhnovic
2024-01-27 15:06:14 +01:00
committed by GitHub
parent 89520f5665
commit 8a4a99b7e8
4 changed files with 62 additions and 18 deletions

View File

@@ -24,14 +24,12 @@ constexpr int MAX_NUMBER_OF_NODES = 65536;
struct CYapfRegionPatchNodeKey {
WaterRegionPatchDesc m_water_region_patch;
static_assert(sizeof(TWaterRegionPatchLabel) == sizeof(byte)); // Important for the hash calculation.
inline void Set(const WaterRegionPatchDesc &water_region_patch)
{
m_water_region_patch = water_region_patch;
}
inline int CalcHash() const { return m_water_region_patch.label | GetWaterRegionIndex(m_water_region_patch) << 8; }
inline int CalcHash() const { return CalculateWaterRegionPatchHash(m_water_region_patch); }
inline bool operator==(const CYapfRegionPatchNodeKey &other) const { return CalcHash() == other.CalcHash(); }
};