mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 13:41:06 +03:00
Compare commits
6 Commits
80da97a9b7
...
0fdac49077
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fdac49077 | ||
|
|
b69a992141 | ||
|
|
afb329c42d | ||
|
|
d253417233 | ||
|
|
0f7f0207ee | ||
|
|
4a102c6ace |
@ -47,6 +47,7 @@ float CGlueMgr::m_aspect;
|
||||
bool CGlueMgr::m_authenticated;
|
||||
const CharacterSelectionDisplay* CGlueMgr::m_characterInfo;
|
||||
int32_t CGlueMgr::m_clientKickReason;
|
||||
int32_t CGlueMgr::m_contestAccepted = 1; // TODO
|
||||
char CGlueMgr::m_currentScreen[64];
|
||||
EffectDeath* CGlueMgr::m_deathEffect;
|
||||
int32_t CGlueMgr::m_disconnectPending;
|
||||
|
||||
@ -41,6 +41,7 @@ class CGlueMgr {
|
||||
static bool m_authenticated;
|
||||
static const CharacterSelectionDisplay* m_characterInfo;
|
||||
static int32_t m_clientKickReason;
|
||||
static int32_t m_contestAccepted;
|
||||
static char m_currentScreen[];
|
||||
static EffectDeath* m_deathEffect;
|
||||
static int32_t m_disconnectPending;
|
||||
|
||||
@ -228,7 +228,14 @@ int32_t Script_ShowContestNotice(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_ContestAccepted(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (CGlueMgr::m_contestAccepted) {
|
||||
lua_pushnumber(L, 1.0);
|
||||
}
|
||||
else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Script_AcceptContest(lua_State* L) {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user