src/TESForms/TESForm.cpp
//get information related to where mods the form is found in
get information related to where mods the form is found in
get information related to where mods the form is found in
void GetFormLocationData(ExtraInfoEntry*& resultArray, RE::TESForm* baseForm, RE::TESForm* refForm)
{
	logger::debug("GetExtraData: GetFormLocationData Start");
	ExtraInfoEntry* formLocationHolder;
	CreateExtraInfoEntry(formLocationHolder, "Form location information", "", priority_FormLocation);
	if (refForm != nullptr && GetHasSourceFileArray(refForm)) {
		logger::debug("GetExtraData: GetFormLocationData ref mod info found");
		std::string refFirstDefinedIn = GetFirstFormLocationName(refForm);
		bool SkyrimESMNotDetectedBug = false;
		if (((refForm->formID & 0xFF000000) == 0) && refFirstDefinedIn != "Skyrim.esm") {
			refFirstDefinedIn = "Skyrim.esm";
			SkyrimESMNotDetectedBug = true;
		}
		ExtraInfoEntry* referenceDefinedIn;
		CreateExtraInfoEntry(referenceDefinedIn, "Reference defined in", refFirstDefinedIn, priority_FormLocation_ReferenceDefined);
		formLocationHolder->PushBack(referenceDefinedIn);
		std::string refLastDefinedIn = GetLastFormLocationName(refForm);
		ExtraInfoEntry* referenceLastChangedBy;
		CreateExtraInfoEntry(referenceLastChangedBy, "Reference last modified by", refLastDefinedIn, priority_FormLocation_ReferenceLastChanged);
		formLocationHolder->PushBack(referenceLastChangedBy);
		ExtraInfoEntry* allModsTouchingReferenceHolder;
		CreateExtraInfoEntry(allModsTouchingReferenceHolder, "Reference found in", "", priority_FormLocation_ReferenceInMods);
		GetModInfoData(allModsTouchingReferenceHolder, refForm, SkyrimESMNotDetectedBug);
		formLocationHolder->PushBack(allModsTouchingReferenceHolder);
	}
	logger::debug("GetExtraData: GetFormLocationData at pBaseSection section");
	if (GetHasSourceFileArray(baseForm)) {
		logger::debug("GetExtraData: GetFormLocationData baseFormModInfo found");
		std::string baseFirstDefinedIn = GetFirstFormLocationName(baseForm);
		ExtraInfoEntry* baseDefinedIn;
		CreateExtraInfoEntry(baseDefinedIn, "Base defined in", baseFirstDefinedIn, priority_FormLocation_BaseDefined);
		formLocationHolder->PushBack(baseDefinedIn);
		std::string baseLastDefinedIn = GetLastFormLocationName(baseForm);
		ExtraInfoEntry* baseLastChangedBy;
		CreateExtraInfoEntry(baseLastChangedBy, "Base last modified by", baseLastDefinedIn, priority_FormLocation_BaseLastChanged);
		formLocationHolder->PushBack(baseLastChangedBy);
		ExtraInfoEntry* allModsTouchingBaseHolder;
		CreateExtraInfoEntry(allModsTouchingBaseHolder, "Base found in", "", priority_FormLocation_BaseInMods);
		GetModInfoData(allModsTouchingBaseHolder, baseForm, false);
		formLocationHolder->PushBack(allModsTouchingBaseHolder);
	}
	resultArray->PushBack(formLocationHolder);
	logger::debug("GetExtraData: GetFormLocationData End");
}
void GetFormLocationData ( ExtraInfoEntry * & resultArray , RE :: TESForm * baseForm , RE :: TESForm * refForm ) { logger :: debug ( " " ) ; ExtraInfoEntry * formLocationHolder ; CreateExtraInfoEntry ( formLocationHolder , " " , " " , priority_FormLocation ) ; if ( refForm != nullptr && GetHasSourceFileArray ( refForm ) ) { logger :: debug ( " " ) ; std :: string refFirstDefinedIn = GetFirstFormLocationName ( refForm ) ; bool SkyrimESMNotDetectedBug = false ; if ( ( ( refForm -> formID & 0xFF000000 ) == 0 ) && refFirstDefinedIn != " " ) { refFirstDefinedIn = " " ; SkyrimESMNotDetectedBug = true ; } ExtraInfoEntry * referenceDefinedIn ; CreateExtraInfoEntry ( referenceDefinedIn , " " , refFirstDefinedIn , priority_FormLocation_ReferenceDefined ) ; formLocationHolder -> PushBack ( referenceDefinedIn ) ; std :: string refLastDefinedIn = GetLastFormLocationName ( refForm ) ; ExtraInfoEntry * referenceLastChangedBy ; CreateExtraInfoEntry ( referenceLastChangedBy , " " , refLastDefinedIn , priority_FormLocation_ReferenceLastChanged ) ; formLocationHolder -> PushBack ( referenceLastChangedBy ) ; ExtraInfoEntry * allModsTouchingReferenceHolder ; CreateExtraInfoEntry ( allModsTouchingReferenceHolder , " " , " " , priority_FormLocation_ReferenceInMods ) ; GetModInfoData ( allModsTouchingReferenceHolder , refForm , SkyrimESMNotDetectedBug ) ; formLocationHolder -> PushBack ( allModsTouchingReferenceHolder ) ; } logger :: debug ( " " ) ; if ( GetHasSourceFileArray ( baseForm ) ) { logger :: debug ( " " ) ; std :: string baseFirstDefinedIn = GetFirstFormLocationName ( baseForm ) ; ExtraInfoEntry * baseDefinedIn ; CreateExtraInfoEntry ( baseDefinedIn , " " , baseFirstDefinedIn , priority_FormLocation_BaseDefined ) ; formLocationHolder -> PushBack ( baseDefinedIn ) ; std :: string baseLastDefinedIn = GetLastFormLocationName ( baseForm ) ; ExtraInfoEntry * baseLastChangedBy ; CreateExtraInfoEntry ( baseLastChangedBy , " " , baseLastDefinedIn , priority_FormLocation_BaseLastChanged ) ; formLocationHolder -> PushBack ( baseLastChangedBy ) ; ExtraInfoEntry * allModsTouchingBaseHolder ; CreateExtraInfoEntry ( allModsTouchingBaseHolder , " " , " " , priority_FormLocation_BaseInMods ) ; GetModInfoData ( allModsTouchingBaseHolder , baseForm , false ) ; formLocationHolder -> PushBack ( allModsTouchingBaseHolder ) ; } resultArray -> PushBack ( formLocationHolder ) ; logger :: debug ( " " ) ; }
get information related to where mods the form is found in
get information related to where mods the form is found in
//this method may be called at a time we only have a base form, and in that case skip anything related to the reform //Reference Form //fix for weird bug where refs first defined in Skyrim.Esm aren't always detected properly //Base Form