Compare commits

...

6 Commits

Author SHA1 Message Date
Tristan 'Natrist' Cormier
9d7611fa7d
Merge b902b5484e into b69a992141 2026-02-12 18:54:21 +00:00
fallenoak
b69a992141
feat(object): implement CGUnit_C::GetModelData
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-11 22:54:36 -06:00
fallenoak
afb329c42d
feat(object): add CGUnit_C::GetLocalDisplayID 2026-02-11 22:39:24 -06:00
fallenoak
d253417233
feat(object): add CGUnit::GetNativeDisplayID 2026-02-11 22:33:39 -06:00
fallenoak
0f7f0207ee
feat(object): add CGUnit::GetDisplayID 2026-02-11 22:21:17 -06:00
Tristan Cormier
b902b5484e feat(glue): implement Script_AcceptedScanning 2026-01-11 17:00:18 -05:00
7 changed files with 54 additions and 3 deletions

View File

@ -39,6 +39,7 @@
#include <cstdio>
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
int32_t CGlueMgr::m_acceptedScanning = 1; // TODO
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
int32_t CGlueMgr::m_accountMsgAvailable;

View File

@ -33,6 +33,7 @@ class CGlueMgr {
// Static variables
static int32_t m_acceptedEULA;
static int32_t m_acceptedScanning;
static int32_t m_acceptedTerminationWithoutNotice;
static int32_t m_acceptedTOS;
static int32_t m_accountMsgAvailable;

View File

@ -216,7 +216,14 @@ int32_t Script_ShowScanningNotice(lua_State* L) {
}
int32_t Script_ScanningAccepted(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
if (CGlueMgr::m_acceptedScanning) {
lua_pushnumber(L, 1.0);
}
else {
lua_pushnil(L);
}
return 1;
}
int32_t Script_AcceptScanning(lua_State* L) {

View File

@ -25,6 +25,14 @@ uint32_t CGUnit::TotalFieldsSaved() {
return CGUnit::GetBaseOffsetSaved() + 123;
}
int32_t CGUnit::GetDisplayID() const {
return this->Unit()->displayID;
}
int32_t CGUnit::GetNativeDisplayID() const {
return this->Unit()->nativeDisplayID;
}
CGUnitData* CGUnit::Unit() const {
return this->m_unit;
}

View File

@ -82,6 +82,10 @@ class CGUnit {
static uint32_t TotalFields();
static uint32_t TotalFieldsSaved();
// Public member functions
int32_t GetDisplayID() const;
int32_t GetNativeDisplayID() const;
protected:
// Protected member variables
CGUnitData* m_unit;

View File

@ -115,9 +115,32 @@ int32_t CGUnit_C::CanBeTargetted() {
return this->CanHighlight();
}
int32_t CGUnit_C::GetLocalDisplayID() const {
return this->m_localDisplayID;
}
CreatureModelDataRec* CGUnit_C::GetModelData() const {
// TODO
return nullptr;
// Prefer local display ID if set and unit's display ID hasn't been overridden from unit's
// native display ID; otherwise prefer overridden display ID.
auto displayID = this->GetLocalDisplayID() && this->GetDisplayID() == this->GetNativeDisplayID()
? this->GetLocalDisplayID()
: this->GetDisplayID();
auto creatureDisplayInfoRec = g_creatureDisplayInfoDB.GetRecord(displayID);
if (!creatureDisplayInfoRec) {
// TODO SysMsgPrintf(1, 2, "NOCREATUREDISPLAYIDFOUND|%d", displayID);
return nullptr;
}
auto creatureModelDataRec = g_creatureModelDataDB.GetRecord(creatureDisplayInfoRec->m_modelID);
if (!creatureModelDataRec) {
// TODO SysMsgPrintf(1, 16, "INVALIDDISPLAYMODELRECORD|%d|%d", creatureDisplayInfoRec->m_modelID, creatureDisplayInfoRec->m_ID);
return nullptr;
}
return creatureModelDataRec;
}
int32_t CGUnit_C::GetModelFileName(const char*& name) const {

View File

@ -31,10 +31,17 @@ class CGUnit_C : public CGObject_C, public CGUnit {
// Public member functions
CGUnit_C(uint32_t time, CClientObjCreate& objCreate);
int32_t GetLocalDisplayID() const;
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);
private:
// Private member variables
// TODO
int32_t m_localDisplayID = 0;
// TODO
};
#endif