1

Track fishing maps; do not check books for the playable flag

This commit is contained in:
Eddoursul 2022-06-24 18:36:52 +02:00
parent 2b1ed09b30
commit d899a2a03f
2 changed files with 15 additions and 18 deletions

View File

@ -16,7 +16,7 @@ namespace BookCheck
const RE::BGSKeyword* recipeKeyword = dataHandler->LookupForm<RE::BGSKeyword>(0xF5CB0, "Skyrim.esm"); // VendorItemRecipe const RE::BGSKeyword* recipeKeyword = dataHandler->LookupForm<RE::BGSKeyword>(0xF5CB0, "Skyrim.esm"); // VendorItemRecipe
for (const auto& form : dataHandler->GetFormArray<RE::TESObjectBOOK>()) { for (const auto& form : dataHandler->GetFormArray<RE::TESObjectBOOK>()) {
if (!form || !form->GetPlayable() || form->TeachesSpell()) { if (!form || form->TeachesSpell()) {
continue; continue;
} }
if (form->HasKeyword(recipeKeyword) || IsBook(form)) { if (form->HasKeyword(recipeKeyword) || IsBook(form)) {
@ -98,17 +98,7 @@ namespace BookCheck
bool IsNote(const char* const modelFileName, size_t modelFileNameLength) bool IsNote(const char* const modelFileName, size_t modelFileNameLength)
{ {
// Most items will use one of the note models from the base game, e.g. Note01.nif. // Most items will use one of the note models from the base game, e.g. Note01.nif.
if (ContainsWholeWord(modelFileName, modelFileNameLength, "Note", 4)) { return ContainsWholeWord(modelFileName, modelFileNameLength, "Note", 4);
return true;
}
// The Creation Club Fishing mod does not include 'Note' the inventory art model names for the
// regional fishing maps, instead those items use the following format: FishMap<region>.
if (StartsWith(modelFileName, modelFileNameLength, "FishMap", 7)) {
return true;
}
return false;
} }
bool IsJournal(const char* const modelFileName, size_t modelFileNameLength) bool IsJournal(const char* const modelFileName, size_t modelFileNameLength)
@ -122,12 +112,6 @@ namespace BookCheck
return false; return false;
} }
RE::BGSSoundDescriptorForm* pickupSound = book->As<RE::BGSPickupPutdownSounds>()->pickupSound;
if (pickupSound && pickupSound->formID == 0xC7A54) { // ITMNoteUp
return false;
}
size_t modelFileNameLength; size_t modelFileNameLength;
const char* const modelFileName = BookCheck::ExtractFileName(book->inventoryModel->GetModel(), modelFileNameLength); const char* const modelFileName = BookCheck::ExtractFileName(book->inventoryModel->GetModel(), modelFileNameLength);
@ -135,6 +119,19 @@ namespace BookCheck
return false; return false;
} }
RE::BGSSoundDescriptorForm* pickupSound = book->As<RE::BGSPickupPutdownSounds>()->pickupSound;
if (pickupSound && pickupSound->formID == 0xC7A54) { // ITMNoteUp
// The Creation Club Fishing mod does not include 'Note' the inventory art model names for the
// regional fishing maps, instead those items use the following format: FishMap<region>.
if (modelFileNameLength >= 11 && StartsWith(modelFileName, modelFileNameLength, "FishMap", 7)) {
return true;
}
return false;
}
if (IsNote(modelFileName, modelFileNameLength) || IsJournal(modelFileName, modelFileNameLength)) { if (IsNote(modelFileName, modelFileNameLength) || IsJournal(modelFileName, modelFileNameLength)) {
return false; return false;
} }