src/main.cpp
void OnInit(SKSE::MessagingInterface::Message* a_msg)
{
	if (a_msg->type == SKSE::MessagingInterface::kDataLoaded) {
		if (rideHorse && patchHorse) {
			const auto reanimateKYWD = RE::TESForm::LookupByID<RE::BGSKeyword>(0x0006F6FB);
			const auto traitGreedy = RE::TESForm::LookupByID<RE::BGSKeyword>(0x000335FA);  //unused keyword in vanilla game.
			if (!reanimateKYWD || !traitGreedy) {
				return;
			}

			if (auto dataHandler = RE::TESDataHandler::GetSingleton(); dataHandler) {
				for (const auto& race : dataHandler->GetFormArray<RE::TESRace>()) {
					if (race && race->HasKeywordString("MagicNoReanimate"sv)) {
						std::string name{ race->GetName() };
						if (SKSE::STRING::insenstiveStringFind(name, "horse"sv)) {
							race->SwapKeyword(reanimateKYWD, traitGreedy);
						}
					}
				}
			}
		}
	}
}
//new method for patching horses, by swapping unused keyword in place of MagicNoReanimate. RemoveKeyword caused crashes (numKeywords wasn't decremented?)
new method for patching horses, by swapping unused keyword in place of MagicNoReanimate. RemoveKeyword caused crashes (numKeywords wasn't decremented?)
new method for patching horses by swapping unused keyword in place of MagicNoReanimate . RemoveKeyword caused crashes ( numKeywords wasn ' t decremented? )
void OnInit(SKSE::MessagingInterface::Message* a_msg)
{
	if (a_msg->type == SKSE::MessagingInterface::kDataLoaded) {
		if (rideHorse && patchHorse) {
			const auto reanimateKYWD = RE::TESForm::LookupByID<RE::BGSKeyword>(0x0006F6FB);
			const auto traitGreedy = RE::TESForm::LookupByID<RE::BGSKeyword>(0x000335FA);  
			if (!reanimateKYWD || !traitGreedy) {
				return;
			}
			if (auto dataHandler = RE::TESDataHandler::GetSingleton(); dataHandler) {
				for (const auto& race : dataHandler->GetFormArray<RE::TESRace>()) {
					if (race && race->HasKeywordString("MagicNoReanimate"sv)) {
						std::string name{ race->GetName() };
						if (SKSE::STRING::insenstiveStringFind(name, "horse"sv)) {
							race->SwapKeyword(reanimateKYWD, traitGreedy);
						}
					}
				}
			}
		}
	}
}
void OnInit ( SKSE :: MessagingInterface :: Message * a_msg ) { if ( a_msg -> type == SKSE :: MessagingInterface :: kDataLoaded ) { if ( rideHorse && patchHorse ) { const auto reanimateKYWD = RE :: TESForm :: LookupByID < RE :: BGSKeyword > ( 0x0006F6FB ) ; const auto traitGreedy = RE :: TESForm :: LookupByID < RE :: BGSKeyword > ( 0x000335FA ) ; if ( ! reanimateKYWD || ! traitGreedy ) { return ; } if ( auto dataHandler = RE :: TESDataHandler :: GetSingleton ( ) ; dataHandler ) { for ( const auto & race : dataHandler -> GetFormArray < RE :: TESRace > ( ) ) { if ( race && race -> HasKeywordString ( " " sv ) ) { std :: string name { race -> GetName ( ) } ; if ( SKSE :: STRING :: insenstiveStringFind ( name , " " sv ) ) { race -> SwapKeyword ( reanimateKYWD , traitGreedy ) ; } } } } } } }
new method for patching horses, by swapping unused keyword in place of MagicNoReanimate.
new method for patching horses by swapping unused keyword in place of MagicNoReanimate .
//unused keyword in vanilla game.