* assign WorldObject position on _MovementUpdate()
* disabled SSE-support, might fix problems on older machines (you can still enable it to increase speed)
This commit is contained in:
parent
bc74818daa
commit
0379c2ccf0
@ -43,12 +43,17 @@ WorldObject::WorldObject()
|
||||
_m = 0;
|
||||
}
|
||||
|
||||
void WorldObject::SetPosition(float x, float y, float z, float o, uint16 _map)
|
||||
void WorldObject::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
_x = x;
|
||||
_y = y;
|
||||
_z = z;
|
||||
_o = o;
|
||||
}
|
||||
|
||||
void WorldObject::SetPosition(float x, float y, float z, float o, uint16 _map)
|
||||
{
|
||||
SetPosition(x,y,z,o);
|
||||
_m = _map;
|
||||
}
|
||||
|
||||
|
||||
@ -92,6 +92,7 @@ class WorldObject : public Object
|
||||
public:
|
||||
virtual ~WorldObject ( ) {}
|
||||
void SetPosition(float x, float y, float z, float o, uint16 _map);
|
||||
void SetPosition(float x, float y, float z, float o);
|
||||
inline float GetX(void) { return _x; }
|
||||
inline float GetY(void) { return _y; }
|
||||
inline float GetZ(void) { return _z; }
|
||||
|
||||
@ -3,13 +3,44 @@
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
enum UnitMoveType
|
||||
{
|
||||
MOVE_WALK =0,
|
||||
MOVE_RUN =1,
|
||||
MOVE_WALKBACK =2,
|
||||
MOVE_SWIM =3,
|
||||
MOVE_SWIMBACK =4,
|
||||
MOVE_TURN =5,
|
||||
MAX_MOVE_TYPE =6
|
||||
};
|
||||
|
||||
enum UnitFlags
|
||||
{
|
||||
UNIT_FLAG_NONE = 0x00000000,
|
||||
UNIT_FLAG_DISABLE_MOVE = 0x00000004,
|
||||
UNIT_FLAG_UNKNOWN1 = 0x00000008, // essential for all units..
|
||||
UNIT_FLAG_RENAME = 0x00000010, // rename creature
|
||||
UNIT_FLAG_RESTING = 0x00000020,
|
||||
UNIT_FLAG_PVP = 0x00001000,
|
||||
UNIT_FLAG_MOUNT = 0x00002000,
|
||||
UNIT_FLAG_DISABLE_ROTATE = 0x00040000,
|
||||
UNIT_FLAG_IN_COMBAT = 0x00080000,
|
||||
UNIT_FLAG_SKINNABLE = 0x04000000,
|
||||
UNIT_FLAG_SHEATHE = 0x40000000
|
||||
};
|
||||
|
||||
|
||||
|
||||
class Unit : public WorldObject
|
||||
{
|
||||
public:
|
||||
Unit();
|
||||
void Create(uint64);
|
||||
uint8 GetGender(void);
|
||||
private:
|
||||
void SetSpeed(uint8 speednr, float speed) { _speed[speednr] = speed; }
|
||||
float GetSpeed(uint8 speednr) { return _speed[speednr]; }
|
||||
protected:
|
||||
float _speed[MAX_MOVE_TYPE];
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -170,6 +170,7 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
|
||||
if(objtypeid==TYPEID_PLAYER)
|
||||
{
|
||||
Unit *u = (Unit*)objmgr.GetObj(uguid);
|
||||
recvPacket >> flags2 >> time;
|
||||
|
||||
if (flags2 & 0x02000000) // On a transport
|
||||
@ -192,9 +193,24 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
recvPacket >> unkf;
|
||||
}
|
||||
recvPacket >> speedWalk >> speedRun >> speedSwimBack >> speedSwim >> speedWalkBack >> speedTurn;
|
||||
if(u)
|
||||
{
|
||||
u->SetPosition(x,y,z,o);
|
||||
u->SetSpeed(MOVE_WALK,speedWalk);
|
||||
u->SetSpeed(MOVE_RUN,speedRun);
|
||||
u->SetSpeed(MOVE_SWIMBACK,speedSwimBack);
|
||||
u->SetSpeed(MOVE_SWIM,speedSwim);
|
||||
u->SetSpeed(MOVE_WALKBACK,speedWalkBack);
|
||||
u->SetSpeed(MOVE_TURN,speedTurn);
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("WorldSession::_MovementUpdate for unknown guid "I64FMT" typeid=%u",uguid,objtypeid);
|
||||
}
|
||||
}
|
||||
if(objtypeid==TYPEID_UNIT)
|
||||
{
|
||||
Unit *u = (Unit*)objmgr.GetObj(uguid);
|
||||
recvPacket >> flags2 >> unk32 >> x >> y >> z >> o >> unkf;
|
||||
recvPacket >> speedWalk >> speedRun >> speedSwimBack >> speedSwim >> speedWalkBack >> speedTurn;
|
||||
|
||||
@ -207,18 +223,41 @@ void WorldSession::_MovementUpdate(uint8 objtypeid, uint64 uguid, WorldPacket& r
|
||||
recvPacket >> unkf >> unkf >> unkf; // Some x, y, z value
|
||||
}
|
||||
}
|
||||
if(u)
|
||||
{
|
||||
u->SetPosition(x,y,z,o);
|
||||
u->SetSpeed(MOVE_WALK,speedWalk);
|
||||
u->SetSpeed(MOVE_RUN,speedRun);
|
||||
u->SetSpeed(MOVE_SWIMBACK,speedSwimBack);
|
||||
u->SetSpeed(MOVE_SWIM,speedSwim);
|
||||
u->SetSpeed(MOVE_WALKBACK,speedWalkBack);
|
||||
u->SetSpeed(MOVE_TURN,speedTurn);
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("WorldSession::_MovementUpdate for unknown guid "I64FMT" typeid=%u",uguid,objtypeid);
|
||||
}
|
||||
}
|
||||
if( (objtypeid==TYPEID_CORPSE) || (objtypeid==TYPEID_GAMEOBJECT) || (objtypeid==TYPEID_DYNAMICOBJECT))
|
||||
{
|
||||
Unit *u = (Unit*)objmgr.GetObj(uguid);
|
||||
if(GUID_HIPART(uguid) != HIGHGUID_TRANSPORT)
|
||||
{
|
||||
recvPacket >> x >> y >> z;
|
||||
if(u)
|
||||
u->SetPosition(x,y,z,u->GetO());
|
||||
else
|
||||
logerror("WorldSession::_MovementUpdate for unknown guid "I64FMT" typeid=%u",uguid,objtypeid);
|
||||
}
|
||||
else
|
||||
{
|
||||
recvPacket >> unk32 >> unk32 >> unk32; // should be 0?
|
||||
}
|
||||
recvPacket >> o;
|
||||
if(u)
|
||||
u->SetPosition(u->GetX(),u->GetY(),u->GetZ(),o);
|
||||
else
|
||||
logerror("WorldSession::_MovementUpdate for unknown guid "I64FMT" typeid=%u",uguid,objtypeid);
|
||||
}
|
||||
|
||||
recvPacket >> unk32; // (uint32)0x1
|
||||
|
||||
@ -27,14 +27,13 @@
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="shared;Client;Client/World;Client/Realm;dep/include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="FALSE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="FALSE"
|
||||
EnableFunctionLevelLinking="FALSE"
|
||||
EnableEnhancedInstructionSet="1"
|
||||
EnableEnhancedInstructionSet="0"
|
||||
PrecompiledHeaderFile=".\Release/PseuWoW.pch"
|
||||
AssemblerListingLocation="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
|
||||
ObjectFile="$(SolutionDir)/temp/$(ProjectName)/$(ConfigurationName)/"
|
||||
@ -71,7 +70,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1031"/>
|
||||
Culture="0"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user