diff --git a/M2TWEOP Code/M2TWEOP library/techFuncs.h b/M2TWEOP Code/M2TWEOP library/techFuncs.h index bbf99ed8..afd0e6d2 100644 --- a/M2TWEOP Code/M2TWEOP library/techFuncs.h +++ b/M2TWEOP Code/M2TWEOP library/techFuncs.h @@ -53,6 +53,7 @@ namespace techFuncs add esp, 0x4 mov retMem, eax } + std::memset(reinterpret_cast(retMem), 0, amount); return reinterpret_cast(retMem); } diff --git a/M2TWEOP Code/M2TWEOP library/types/faction.cpp b/M2TWEOP Code/M2TWEOP library/types/faction.cpp index eb183497..0a1c50bc 100644 --- a/M2TWEOP Code/M2TWEOP library/types/faction.cpp +++ b/M2TWEOP Code/M2TWEOP library/types/faction.cpp @@ -133,8 +133,11 @@ void factionRecord::setFactionBattleModel(const std::string& model, const int ch const auto charTypeEntry = &descrCharacterPtr->entries[characterType]; const auto factionEntry = charTypeEntry->ptrsToDescrCharacterFactionEntries[id]; factionEntry->battleMod = techFuncs::createGameClass(); + factionEntry->battleMod->name = nullptr; + factionEntry->battleMod->nameHash = 0; factionEntry->battleMod->modelGroup = 0; factionEntry->battleMod->modelIndex = 0; + factionEntry->battleMod->modelEntry = nullptr; gameStringHelpers::setHashedString(&factionEntry->battleMod->name, model.c_str()); factionEntry->battleMod->modelEntry = battleMod; }