diff --git a/SKSE/Plugins/doticu_skypal.dll b/SKSE/Plugins/doticu_skypal.dll index 3dc65e0..826c8a5 100644 Binary files a/SKSE/Plugins/doticu_skypal.dll and b/SKSE/Plugins/doticu_skypal.dll differ diff --git a/Source/Plugins/doticu_skypal/src/references.cpp b/Source/Plugins/doticu_skypal/src/references.cpp index 5cec154..152d1a8 100644 --- a/Source/Plugins/doticu_skypal/src/references.cpp +++ b/Source/Plugins/doticu_skypal/src/references.cpp @@ -36,6 +36,10 @@ #include "doticu_skypal/main.h" #include "doticu_skypal/references.h" +//temp +#include "doticu_skylib/virtual_debug.h" +// + namespace doticu_skypal { String_t References_t::Class_Name() @@ -85,16 +89,42 @@ namespace doticu_skypal { #undef STATIC } + //temp + void Test_For_Dupes(Vector_t& refs) + { + for (size_t idx = 0, end = refs.size(); idx < end; idx += 1) { + maybe reference = refs[idx]; + SKYLIB_ASSERT_SOME(reference); + + size_t count = 0; + for (size_t idx = 0, end = refs.size(); idx < end; idx += 1) { + if (refs[idx] == reference) { + count += 1; + } + } + + if (count > 1) { + std::string note = + std::string("SkyPal: FOUND A DUPLICATE") + + " [" + reference->form_id.As_String() + " - " + reference->Any_Name() + "]"; + skylib::Virtual::Debug_t::Trace(note, 2, none()); + } else { + skylib::Virtual::Debug_t::Trace("SkyPal: no duplicates found.", 0, none()); + } + } + } + // + /* Getters */ Vector_t References_t::All() { - return *reinterpret_cast*>(&Reference_t::Loaded_References()); + return *reinterpret_cast*>(&Reference_t::All()); } Vector_t References_t::Grid() { - return *reinterpret_cast*>(&Reference_t::Loaded_Grid_References()); + return *reinterpret_cast*>(&Reference_t::Grid()); } /* Counters */ @@ -367,6 +397,10 @@ namespace doticu_skypal { Filter::Keywords_t(state).OR>&>(some_keywords); } + //temp + Test_For_Dupes(*state.Results()); + // + return *state.Results(); }