Skip to content

Commit

Permalink
fix class init
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnTW committed Oct 29, 2024
1 parent e24fea6 commit 556715b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions M2TWEOP Code/M2TWEOP library/techFuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace techFuncs
add esp, 0x4
mov retMem, eax
}
std::memset(reinterpret_cast<void*>(retMem), 0, amount);
return reinterpret_cast<T*>(retMem);
}

Expand Down
3 changes: 3 additions & 0 deletions M2TWEOP Code/M2TWEOP library/types/faction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<eduOfficer>();
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;
}
Expand Down

0 comments on commit 556715b

Please sign in to comment.