Compare commits

..

2 Commits

Author SHA1 Message Date
Tristan 'Natrist' Cormier
b3eb3e7a17
Merge c12a79d6e6 into 5a69128f63 2026-02-10 19:05:55 -05:00
fallenoak
5a69128f63
feat(object): add CGUnit_C::GetModelFileName
Some checks failed
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Has been cancelled
2026-02-10 16:00:15 -06:00
4 changed files with 26 additions and 2 deletions

View File

@ -95,7 +95,7 @@ void CGObject_C::Disable() {
this->m_disableTimeMs = CWorld::GetCurTimeMs();
}
int32_t CGObject_C::GetModelFileName(const char*& name) {
int32_t CGObject_C::GetModelFileName(const char*& name) const {
return false;
}

View File

@ -36,7 +36,7 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
virtual void HandleOutOfRange(OUT_OF_RANGE_TYPE type) {};
virtual void UpdateWorldObject(int32_t a2);
// TODO
virtual int32_t GetModelFileName(const char*& name);
virtual int32_t GetModelFileName(const char*& name) const;
// TODO
virtual int32_t CanHighlight();
virtual int32_t CanBeTargetted();

View File

@ -115,6 +115,26 @@ int32_t CGUnit_C::CanBeTargetted() {
return this->CanHighlight();
}
CreatureModelDataRec* CGUnit_C::GetModelData() const {
// TODO
return nullptr;
}
int32_t CGUnit_C::GetModelFileName(const char*& name) const {
auto modelDataRec = this->GetModelData();
// Model data not found
if (!modelDataRec) {
name = "Spells\\ErrorCube.mdx";
return true;
}
name = modelDataRec->m_modelName;
return modelDataRec->m_modelName ? true : false;
}
void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
// TODO

View File

@ -9,6 +9,7 @@
class ChrClassesRec;
class ChrRacesRec;
class CreatureModelDataRec;
class CGUnit_C : public CGObject_C, public CGUnit {
public:
@ -22,12 +23,15 @@ class CGUnit_C : public CGObject_C, public CGUnit {
// Virtual public member functions
virtual ~CGUnit_C();
// TODO
virtual int32_t GetModelFileName(const char*& name) const;
// TODO
virtual int32_t CanHighlight();
virtual int32_t CanBeTargetted();
// TODO
// Public member functions
CGUnit_C(uint32_t time, CClientObjCreate& objCreate);
CreatureModelDataRec* GetModelData() const;
void PostInit(uint32_t time, const CClientObjCreate& init, bool a4);
void PostMovementUpdate(const CClientMoveUpdate& move, int32_t activeMover);
void SetStorage(uint32_t* storage, uint32_t* saved);