mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 13:41:06 +03:00
Compare commits
1 Commits
9ce41b2da0
...
b4a1129cb9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4a1129cb9 |
@ -38,9 +38,7 @@
|
|||||||
#include <common/MD5.hpp>
|
#include <common/MD5.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
int32_t CGlueMgr::m_acceptedContest = 1; // TODO
|
|
||||||
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
|
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
|
||||||
int32_t CGlueMgr::m_acceptedScanning = 1; // TODO
|
|
||||||
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
|
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
|
||||||
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
|
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
|
||||||
int32_t CGlueMgr::m_accountMsgAvailable;
|
int32_t CGlueMgr::m_accountMsgAvailable;
|
||||||
@ -395,11 +393,6 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IDLE_CREATE_CHARACTER: {
|
|
||||||
CGlueMgr::PollCreateCharacter(msg, complete, result);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case IDLE_DELETE_CHARACTER: {
|
case IDLE_DELETE_CHARACTER: {
|
||||||
CGlueMgr::PollDeleteCharacter(msg, complete, result);
|
CGlueMgr::PollDeleteCharacter(msg, complete, result);
|
||||||
break;
|
break;
|
||||||
@ -770,37 +763,6 @@ void CGlueMgr::PollCharacterList(const char* msg, int32_t complete, int32_t resu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGlueMgr::PollCreateCharacter(const char* msg, int32_t complete, int32_t result) {
|
|
||||||
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);
|
|
||||||
|
|
||||||
if (CGlueMgr::HandleBattlenetDisconnect()) {
|
|
||||||
CGlueMgr::SetIdleState(IDLE_NONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!complete) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Error
|
|
||||||
|
|
||||||
if (result == 0) {
|
|
||||||
FrameScript_SignalEvent(OPEN_STATUS_DIALOG, "%s%s", "OKAY", msg);
|
|
||||||
|
|
||||||
CGlueMgr::SetIdleState(IDLE_NONE);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Success
|
|
||||||
|
|
||||||
CGlueMgr::SetIdleState(IDLE_NONE);
|
|
||||||
|
|
||||||
FrameScript_SignalEvent(CLOSE_STATUS_DIALOG, nullptr);
|
|
||||||
FrameScript_SignalEvent(SELECT_LAST_CHARACTER, nullptr);
|
|
||||||
|
|
||||||
CGlueMgr::SetScreen("charselect");
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGlueMgr::PollDeleteCharacter(const char* msg, int32_t complete, int32_t result) {
|
void CGlueMgr::PollDeleteCharacter(const char* msg, int32_t complete, int32_t result) {
|
||||||
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);
|
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);
|
||||||
|
|
||||||
|
|||||||
@ -32,9 +32,7 @@ class CGlueMgr {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Static variables
|
// Static variables
|
||||||
static int32_t m_acceptedContest;
|
|
||||||
static int32_t m_acceptedEULA;
|
static int32_t m_acceptedEULA;
|
||||||
static int32_t m_acceptedScanning;
|
|
||||||
static int32_t m_acceptedTerminationWithoutNotice;
|
static int32_t m_acceptedTerminationWithoutNotice;
|
||||||
static int32_t m_acceptedTOS;
|
static int32_t m_acceptedTOS;
|
||||||
static int32_t m_accountMsgAvailable;
|
static int32_t m_accountMsgAvailable;
|
||||||
@ -82,7 +80,6 @@ class CGlueMgr {
|
|||||||
static int32_t OnKickReasonMsg(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
static int32_t OnKickReasonMsg(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||||
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
||||||
static void PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode);
|
static void PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode);
|
||||||
static void PollCreateCharacter(const char* msg, int32_t complete, int32_t result);
|
|
||||||
static void PollDeleteCharacter(const char* msg, int32_t complete, int32_t result);
|
static void PollDeleteCharacter(const char* msg, int32_t complete, int32_t result);
|
||||||
static void PollEnterWorld();
|
static void PollEnterWorld();
|
||||||
static void PollLoginServerLogin();
|
static void PollLoginServerLogin();
|
||||||
|
|||||||
@ -204,13 +204,7 @@ int32_t Script_ShowTerminationWithoutNoticeNotice(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_TerminationWithoutNoticeAccepted(lua_State* L) {
|
int32_t Script_TerminationWithoutNoticeAccepted(lua_State* L) {
|
||||||
if (CGlueMgr::m_acceptedTerminationWithoutNotice) {
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
} else {
|
|
||||||
lua_pushnil(L);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AcceptTerminationWithoutNotice(lua_State* L) {
|
int32_t Script_AcceptTerminationWithoutNotice(lua_State* L) {
|
||||||
@ -222,13 +216,7 @@ int32_t Script_ShowScanningNotice(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_ScanningAccepted(lua_State* L) {
|
int32_t Script_ScanningAccepted(lua_State* L) {
|
||||||
if (CGlueMgr::m_acceptedScanning) {
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
} else {
|
|
||||||
lua_pushnil(L);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AcceptScanning(lua_State* L) {
|
int32_t Script_AcceptScanning(lua_State* L) {
|
||||||
@ -240,13 +228,7 @@ int32_t Script_ShowContestNotice(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_ContestAccepted(lua_State* L) {
|
int32_t Script_ContestAccepted(lua_State* L) {
|
||||||
if (CGlueMgr::m_acceptedContest) {
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
} else {
|
|
||||||
lua_pushnil(L);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AcceptContest(lua_State* L) {
|
int32_t Script_AcceptContest(lua_State* L) {
|
||||||
|
|||||||
@ -104,10 +104,6 @@ void ClientConnection::GetRealmList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientConnection::HandleCharacterCreate(uint8_t result) {
|
|
||||||
this->Complete(result == 47, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClientConnection::HandleCharacterDelete(uint8_t result) {
|
void ClientConnection::HandleCharacterDelete(uint8_t result) {
|
||||||
this->Complete(result == 71, result);
|
this->Complete(result == 71, result);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,6 @@ class ClientConnection : public RealmConnection {
|
|||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual int32_t HandleConnect();
|
virtual int32_t HandleConnect();
|
||||||
virtual void HandleCharacterCreate(uint8_t result);
|
|
||||||
virtual void HandleCharacterDelete(uint8_t result);
|
virtual void HandleCharacterDelete(uint8_t result);
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|||||||
@ -20,7 +20,7 @@ int32_t RealmConnection::MessageHandler(void* param, NETMESSAGE msgId, uint32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
case SMSG_CHAR_CREATE: {
|
case SMSG_CHAR_CREATE: {
|
||||||
result = connection->CreateCharHandler(msgId, time, msg);
|
// TODO
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,15 +294,6 @@ int32_t RealmConnection::HandleCharEnum(uint32_t msgId, uint32_t time, CDataStor
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t RealmConnection::CreateCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg) {
|
|
||||||
uint8_t result;
|
|
||||||
msg->Get(result);
|
|
||||||
|
|
||||||
this->HandleCharacterCreate(result);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t RealmConnection::DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg) {
|
int32_t RealmConnection::DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg) {
|
||||||
uint8_t result;
|
uint8_t result;
|
||||||
msg->Get(result);
|
msg->Get(result);
|
||||||
|
|||||||
@ -46,14 +46,12 @@ class RealmConnection : public NetClient {
|
|||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual int32_t HandleAuthChallenge(AuthenticationChallenge* challenge);
|
virtual int32_t HandleAuthChallenge(AuthenticationChallenge* challenge);
|
||||||
virtual void HandleCharacterCreate(uint8_t result) = 0;
|
|
||||||
virtual void HandleCharacterDelete(uint8_t result) = 0;
|
virtual void HandleCharacterDelete(uint8_t result) = 0;
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
RealmConnection(RealmResponse* realmResponse);
|
RealmConnection(RealmResponse* realmResponse);
|
||||||
int32_t HandleAuthResponse(uint32_t msgId, uint32_t time, CDataStore* msg);
|
int32_t HandleAuthResponse(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
int32_t CreateCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg);
|
|
||||||
int32_t DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg);
|
int32_t DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
void RequestCharacterEnum();
|
void RequestCharacterEnum();
|
||||||
void RequestCharacterLogin(uint64_t guid, int32_t a2);
|
void RequestCharacterLogin(uint64_t guid, int32_t a2);
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#include "object/client/CGUnit.hpp"
|
#include "object/client/CGUnit.hpp"
|
||||||
#include "object/client/CGObject.hpp"
|
#include "object/client/CGObject.hpp"
|
||||||
#include "object/client/CMovement_C.hpp"
|
|
||||||
|
|
||||||
uint32_t CGUnit::GetBaseOffset() {
|
uint32_t CGUnit::GetBaseOffset() {
|
||||||
return CGObject::TotalFields();
|
return CGObject::TotalFields();
|
||||||
@ -30,18 +29,10 @@ int32_t CGUnit::GetDisplayID() const {
|
|||||||
return this->Unit()->displayID;
|
return this->Unit()->displayID;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CGUnit::GetFacing() const {
|
|
||||||
return this->m_move->GetFacing();
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t CGUnit::GetNativeDisplayID() const {
|
int32_t CGUnit::GetNativeDisplayID() const {
|
||||||
return this->Unit()->nativeDisplayID;
|
return this->Unit()->nativeDisplayID;
|
||||||
}
|
}
|
||||||
|
|
||||||
C3Vector CGUnit::GetPosition() const {
|
|
||||||
return this->m_move->GetPosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
CGUnitData* CGUnit::Unit() const {
|
CGUnitData* CGUnit::Unit() const {
|
||||||
return this->m_unit;
|
return this->m_unit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,8 @@
|
|||||||
#define OBJECT_CLIENT_CG_UNIT_HPP
|
#define OBJECT_CLIENT_CG_UNIT_HPP
|
||||||
|
|
||||||
#include "util/GUID.hpp"
|
#include "util/GUID.hpp"
|
||||||
#include <tempest/Vector.hpp>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class CMovement_C;
|
|
||||||
|
|
||||||
struct CGUnitData {
|
struct CGUnitData {
|
||||||
WOWGUID charm;
|
WOWGUID charm;
|
||||||
WOWGUID summon;
|
WOWGUID summon;
|
||||||
@ -86,18 +83,13 @@ class CGUnit {
|
|||||||
static uint32_t TotalFieldsSaved();
|
static uint32_t TotalFieldsSaved();
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGUnit(CMovement_C& move)
|
|
||||||
: m_move(&move) {};
|
|
||||||
int32_t GetDisplayID() const;
|
int32_t GetDisplayID() const;
|
||||||
float GetFacing() const;
|
|
||||||
int32_t GetNativeDisplayID() const;
|
int32_t GetNativeDisplayID() const;
|
||||||
C3Vector GetPosition() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Protected member variables
|
// Protected member variables
|
||||||
CGUnitData* m_unit;
|
CGUnitData* m_unit;
|
||||||
uint32_t* m_unitSaved;
|
uint32_t* m_unitSaved;
|
||||||
CMovement_C* m_move;
|
|
||||||
|
|
||||||
// Protected member functions
|
// Protected member functions
|
||||||
CGUnitData* Unit() const;
|
CGUnitData* Unit() const;
|
||||||
|
|||||||
@ -96,11 +96,7 @@ const char* CGUnit_C::GetDisplayRaceNameFromRecord(const ChrRacesRec* raceRec, U
|
|||||||
return raceRec->m_name;
|
return raceRec->m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGUnit_C::CGUnit_C(uint32_t time, CClientObjCreate& objCreate)
|
CGUnit_C::CGUnit_C(uint32_t time, CClientObjCreate& objCreate) : CGObject_C(time, objCreate) {
|
||||||
: CGObject_C(time, objCreate)
|
|
||||||
, CGUnit(this->m_localMove)
|
|
||||||
, m_localMove(objCreate.move.status.position28, objCreate.move.status.facing34, this->GetGUID(), this)
|
|
||||||
{
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
this->RefreshDataPointers();
|
this->RefreshDataPointers();
|
||||||
@ -136,10 +132,6 @@ int32_t CGUnit_C::GetDisplayID() const {
|
|||||||
return this->CGUnit::GetDisplayID();
|
return this->CGUnit::GetDisplayID();
|
||||||
}
|
}
|
||||||
|
|
||||||
float CGUnit_C::GetFacing() const {
|
|
||||||
return this->CGUnit::GetFacing();
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t CGUnit_C::GetLocalDisplayID() const {
|
int32_t CGUnit_C::GetLocalDisplayID() const {
|
||||||
return this->m_localDisplayID;
|
return this->m_localDisplayID;
|
||||||
}
|
}
|
||||||
@ -179,10 +171,6 @@ int32_t CGUnit_C::GetModelFileName(const char*& name) const {
|
|||||||
return modelDataRec->m_modelName ? true : false;
|
return modelDataRec->m_modelName ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
C3Vector CGUnit_C::GetPosition() const {
|
|
||||||
return this->CGUnit::GetPosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
|
void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
#include "object/client/CClientObjCreate.hpp"
|
#include "object/client/CClientObjCreate.hpp"
|
||||||
#include "object/client/CGObject_C.hpp"
|
#include "object/client/CGObject_C.hpp"
|
||||||
#include "object/client/CGUnit.hpp"
|
#include "object/client/CGUnit.hpp"
|
||||||
#include "object/client/CMovement_C.hpp"
|
|
||||||
#include "object/Types.hpp"
|
#include "object/Types.hpp"
|
||||||
#include "util/GUID.hpp"
|
#include "util/GUID.hpp"
|
||||||
|
|
||||||
@ -28,10 +27,6 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
|||||||
// Virtual public member functions
|
// Virtual public member functions
|
||||||
virtual ~CGUnit_C();
|
virtual ~CGUnit_C();
|
||||||
// TODO
|
// TODO
|
||||||
virtual C3Vector GetPosition() const;
|
|
||||||
// TODO
|
|
||||||
virtual float GetFacing() const;
|
|
||||||
// TODO
|
|
||||||
virtual int32_t GetModelFileName(const char*& name) const;
|
virtual int32_t GetModelFileName(const char*& name) const;
|
||||||
// TODO
|
// TODO
|
||||||
virtual int32_t CanHighlight();
|
virtual int32_t CanHighlight();
|
||||||
@ -54,14 +49,12 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
|||||||
private:
|
private:
|
||||||
// Private member variables
|
// Private member variables
|
||||||
// TODO
|
// TODO
|
||||||
CMovement_C m_localMove;
|
CreatureDisplayInfoRec* m_displayInfo;
|
||||||
|
CreatureDisplayInfoExtraRec* m_displayInfoExtra;
|
||||||
|
CreatureModelDataRec* m_modelData;
|
||||||
|
CreatureSoundDataRec* m_soundData;
|
||||||
// TODO
|
// TODO
|
||||||
CreatureDisplayInfoRec* m_displayInfo = nullptr;
|
UnitBloodLevelsRec* m_bloodRec;
|
||||||
CreatureDisplayInfoExtraRec* m_displayInfoExtra = nullptr;
|
|
||||||
CreatureModelDataRec* m_modelData = nullptr;
|
|
||||||
CreatureSoundDataRec* m_soundData = nullptr;
|
|
||||||
// TODO
|
|
||||||
UnitBloodLevelsRec* m_bloodRec = nullptr;
|
|
||||||
// TODO
|
// TODO
|
||||||
int32_t m_localDisplayID = 0;
|
int32_t m_localDisplayID = 0;
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
#include "object/client/CMovementData_C.hpp"
|
|
||||||
|
|
||||||
CMovementData_C::CMovementData_C(const C3Vector& position, float facing, const WOWGUID& guid, CGUnit_C* unit)
|
|
||||||
: CMovementShared(0, position, facing, guid)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#ifndef OBJECT_CLIENT_C_MOVEMENT_DATA_C_HPP
|
|
||||||
#define OBJECT_CLIENT_C_MOVEMENT_DATA_C_HPP
|
|
||||||
|
|
||||||
#include "object/movement/CMovementShared.hpp"
|
|
||||||
|
|
||||||
class CGUnit_C;
|
|
||||||
|
|
||||||
class CMovementData_C : public CMovementShared {
|
|
||||||
public:
|
|
||||||
// Public member functions
|
|
||||||
CMovementData_C(const C3Vector& position, float facing, const WOWGUID& guid, CGUnit_C* unit);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
#ifndef OBJECT_CLIENT_C_MOVEMENT_C_HPP
|
|
||||||
#define OBJECT_CLIENT_C_MOVEMENT_C_HPP
|
|
||||||
|
|
||||||
#include "object/client/CMovementData_C.hpp"
|
|
||||||
#include "util/GUID.hpp"
|
|
||||||
#include <tempest/Vector.hpp>
|
|
||||||
|
|
||||||
class CMovement_C : public CMovementData_C {
|
|
||||||
public:
|
|
||||||
// Public member functions
|
|
||||||
CMovement_C(const C3Vector& position, float facing, const WOWGUID& guid, CGUnit_C* unit)
|
|
||||||
: CMovementData_C(position, facing, guid, unit) {};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
#include "object/movement/CMovementShared.hpp"
|
|
||||||
|
|
||||||
CMovementShared::CMovementShared(const WOWGUID& transportGUID, const C3Vector& position, float facing, const WOWGUID& guid)
|
|
||||||
: CPassenger(transportGUID, position, guid)
|
|
||||||
{
|
|
||||||
this->m_facing = facing;
|
|
||||||
|
|
||||||
this->m_anchorPosition = position;
|
|
||||||
this->m_anchorFacing = facing;
|
|
||||||
this->m_anchorPitch = 0.0f;
|
|
||||||
this->m_cosAnchorPitch = 1.0f;
|
|
||||||
this->m_sinAnchorPitch = 0.0f;
|
|
||||||
|
|
||||||
this->m_spline = nullptr;
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
#ifndef OBJECT_MOVEMENT_C_MOVEMENT_SHARED_HPP
|
|
||||||
#define OBJECT_MOVEMENT_C_MOVEMENT_SHARED_HPP
|
|
||||||
|
|
||||||
#include "object/movement/CPassenger.hpp"
|
|
||||||
#include "util/GUID.hpp"
|
|
||||||
#include <tempest/Vector.hpp>
|
|
||||||
|
|
||||||
struct CMoveSpline;
|
|
||||||
|
|
||||||
class CMovementShared : public CPassenger {
|
|
||||||
public:
|
|
||||||
// Public member functions
|
|
||||||
CMovementShared(const WOWGUID& transportGUID, const C3Vector& position, float facing, const WOWGUID& guid);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Protected member variables
|
|
||||||
// TODO
|
|
||||||
C3Vector m_anchorPosition;
|
|
||||||
float m_anchorFacing;
|
|
||||||
float m_anchorPitch;
|
|
||||||
// TODO
|
|
||||||
C3Vector m_direction;
|
|
||||||
C2Vector m_direction2d;
|
|
||||||
float m_cosAnchorPitch;
|
|
||||||
float m_sinAnchorPitch;
|
|
||||||
// TODO
|
|
||||||
CMoveSpline* m_spline;
|
|
||||||
// TODO
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -48,7 +48,7 @@ CDataStore& operator>>(CDataStore& msg, CMovementStatus& move) {
|
|||||||
msg.Get(move.uint14);
|
msg.Get(move.uint14);
|
||||||
msg.Get(move.uint0);
|
msg.Get(move.uint0);
|
||||||
|
|
||||||
msg >> move.position28;
|
msg >> move.position18;
|
||||||
msg.Get(move.facing34);
|
msg.Get(move.facing34);
|
||||||
|
|
||||||
if (move.moveFlags & 0x200) {
|
if (move.moveFlags & 0x200) {
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
#include "object/movement/CPassenger.hpp"
|
|
||||||
#include <tempest/Matrix.hpp>
|
|
||||||
|
|
||||||
float CPassenger::GetFacing() const {
|
|
||||||
return this->GetFacing(this->m_facing);
|
|
||||||
}
|
|
||||||
|
|
||||||
float CPassenger::GetFacing(float facing) const {
|
|
||||||
// If on transport, transform facing by transport facing
|
|
||||||
if (this->m_transportGUID) {
|
|
||||||
float transportFacing = 0.0f;
|
|
||||||
// TODO MovementGetTransportFacing(this->m_transportGUID);
|
|
||||||
|
|
||||||
return facing + transportFacing;
|
|
||||||
}
|
|
||||||
|
|
||||||
return facing;
|
|
||||||
}
|
|
||||||
|
|
||||||
C3Vector CPassenger::GetPosition() const {
|
|
||||||
return this->GetPosition(this->m_position);
|
|
||||||
}
|
|
||||||
|
|
||||||
C3Vector CPassenger::GetPosition(const C3Vector& position) const {
|
|
||||||
// If on transport, transform position by transport matrix
|
|
||||||
if (this->m_transportGUID) {
|
|
||||||
C44Matrix transportMatrix;
|
|
||||||
// TODO MovementGetTransportMtxX(this->m_transportGUID, &transportMatrix);
|
|
||||||
|
|
||||||
return position * transportMatrix;
|
|
||||||
}
|
|
||||||
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
#ifndef OBJECT_MOVEMENT_C_PASSENGER_HPP
|
|
||||||
#define OBJECT_MOVEMENT_C_PASSENGER_HPP
|
|
||||||
|
|
||||||
#include "util/GUID.hpp"
|
|
||||||
#include <tempest/Vector.hpp>
|
|
||||||
|
|
||||||
class CPassenger {
|
|
||||||
public:
|
|
||||||
// Public member functions
|
|
||||||
CPassenger(const WOWGUID& transportGUID, const C3Vector& position, const WOWGUID& guid)
|
|
||||||
: m_transportGUID(transportGUID)
|
|
||||||
, m_position(position)
|
|
||||||
, m_facing(0.0f)
|
|
||||||
, m_guid(guid) {};
|
|
||||||
float GetFacing() const;
|
|
||||||
float GetFacing(float facing) const;
|
|
||||||
C3Vector GetPosition() const;
|
|
||||||
C3Vector GetPosition(const C3Vector& position) const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Protected member variables
|
|
||||||
// TODO
|
|
||||||
WOWGUID m_transportGUID;
|
|
||||||
C3Vector m_position;
|
|
||||||
// TODO
|
|
||||||
float m_facing;
|
|
||||||
// TODO
|
|
||||||
const WOWGUID& m_guid;
|
|
||||||
// TODO
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Loading…
Reference in New Issue
Block a user