parent
61aff2af12
commit
246acb19f9
|
@ -3047,9 +3047,9 @@ void cClientHandle::SendSpawnMob(const cMonster & a_Mob)
|
|||
|
||||
|
||||
|
||||
void cClientHandle::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch)
|
||||
void cClientHandle::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData)
|
||||
{
|
||||
m_Protocol->SendSpawnObject(a_Entity, a_ObjectType, a_ObjectData, a_Yaw, a_Pitch);
|
||||
m_Protocol->SendSpawnObject(a_Entity, a_ObjectType, a_ObjectData);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ public: // tolua_export
|
|||
void SendSoundParticleEffect (const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data);
|
||||
void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock);
|
||||
void SendSpawnMob (const cMonster & a_Mob);
|
||||
void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch);
|
||||
void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData);
|
||||
void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType = 0);
|
||||
void SendStatistics (const cStatManager & a_Manager);
|
||||
void SendTabCompletionResults (const AStringVector & a_Results);
|
||||
|
|
|
@ -9,16 +9,6 @@
|
|||
|
||||
|
||||
|
||||
/** Converts an angle in degrees into a byte representation used by the network protocol */
|
||||
static Byte AngleToProto(double a_X)
|
||||
{
|
||||
return static_cast<Byte>((a_X * 255) / 360);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cArrowEntity::cArrowEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
Super(pkArrow, a_Creator, a_Pos, a_Speed, 0.5, 0.5),
|
||||
m_PickupState(psNoPickup),
|
||||
|
@ -173,7 +163,7 @@ void cArrowEntity::CollectedBy(cPlayer & a_Dest)
|
|||
|
||||
void cArrowEntity::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendSpawnObject(*this, m_ProjectileKind, static_cast<int>(m_CreatorData.m_UniqueID + 1), AngleToProto(GetYaw()), AngleToProto(GetPitch()));
|
||||
a_Client.SendSpawnObject(*this, m_ProjectileKind, static_cast<int>(m_CreatorData.m_UniqueID + 1));
|
||||
a_Client.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ cEnderCrystal::cEnderCrystal(Vector3d a_Pos):
|
|||
|
||||
void cEnderCrystal::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
a_ClientHandle.SendSpawnObject(*this, 51, 0, static_cast<Byte>(GetYaw()), static_cast<Byte>(GetPitch()));
|
||||
a_ClientHandle.SendSpawnObject(*this, 51, 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ cFloater::cFloater(Vector3d a_Pos, Vector3d a_Speed, UInt32 a_PlayerID, int a_Co
|
|||
|
||||
void cFloater::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendSpawnObject(*this, 90, static_cast<int>(m_PlayerID), 0, 0);
|
||||
a_Client.SendSpawnObject(*this, 90, static_cast<int>(m_PlayerID));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ void cItemFrame::GetDrops(cItems & a_Items, cEntity * a_Killer)
|
|||
void cItemFrame::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
Super::SpawnOn(a_ClientHandle);
|
||||
a_ClientHandle.SendSpawnObject(*this, 71, GetProtocolFacing(), static_cast<Byte>(GetYaw()), static_cast<Byte>(GetPitch()));
|
||||
a_ClientHandle.SendSpawnObject(*this, 71, GetProtocolFacing());
|
||||
a_ClientHandle.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ void cLeashKnot::GetDrops(cItems & a_Items, cEntity * a_Killer)
|
|||
void cLeashKnot::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
Super::SpawnOn(a_ClientHandle);
|
||||
a_ClientHandle.SendSpawnObject(*this, 77, GetProtocolFacing(), static_cast<Byte>(GetYaw()), static_cast<Byte>(GetPitch()));
|
||||
a_ClientHandle.SendSpawnObject(*this, 77, GetProtocolFacing());
|
||||
a_ClientHandle.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,13 +30,6 @@
|
|||
|
||||
|
||||
|
||||
/** Converts an angle in radians into a byte representation used by the network protocol */
|
||||
#define ANGLE_TO_PROTO(X) static_cast<Byte>(X * 255 / 360)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cProjectileTracerCallback:
|
||||
|
||||
|
@ -451,7 +444,7 @@ void cProjectileEntity::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a
|
|||
void cProjectileEntity::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
// Default spawning - use the projectile kind to spawn an object:
|
||||
a_Client.SendSpawnObject(*this, m_ProjectileKind, 12, ANGLE_TO_PROTO(GetYaw()), ANGLE_TO_PROTO(GetPitch()));
|
||||
a_Client.SendSpawnObject(*this, m_ProjectileKind, 12);
|
||||
a_Client.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,13 +9,6 @@
|
|||
|
||||
|
||||
|
||||
/** Converts an angle in radians into a byte representation used by the network protocol */
|
||||
#define ANGLE_TO_PROTO(X) static_cast<Byte>(X * 255 / 360)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cSplashPotionEntity:
|
||||
|
||||
|
@ -103,7 +96,7 @@ void cSplashPotionEntity::Splash(Vector3d a_HitPos)
|
|||
|
||||
void cSplashPotionEntity::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendSpawnObject(*this, 73, m_PotionColor, ANGLE_TO_PROTO(GetYaw()), ANGLE_TO_PROTO(GetPitch()));
|
||||
a_Client.SendSpawnObject(*this, 73, m_PotionColor);
|
||||
a_Client.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ cTNTEntity::cTNTEntity(Vector3d a_Pos, int a_FuseTicks) :
|
|||
|
||||
void cTNTEntity::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
a_ClientHandle.SendSpawnObject(*this, 50, 1, 0, 0); // 50 means TNT
|
||||
a_ClientHandle.SendSpawnObject(*this, 50, 1); // 50 means TNT
|
||||
m_bDirtyOrientation = false;
|
||||
m_bDirtyHead = false;
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ public:
|
|||
virtual void SendSoundParticleEffect (const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) = 0;
|
||||
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) = 0;
|
||||
virtual void SendSpawnMob (const cMonster & a_Mob) = 0;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) = 0;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData) = 0;
|
||||
virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) = 0;
|
||||
virtual void SendStatistics (const cStatManager & a_Manager) = 0;
|
||||
virtual void SendTabCompletionResults (const AStringVector & a_Results) = 0;
|
||||
|
|
|
@ -850,10 +850,10 @@ void cProtocolRecognizer::SendSpawnMob(const cMonster & a_Mob)
|
|||
|
||||
|
||||
|
||||
void cProtocolRecognizer::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch)
|
||||
void cProtocolRecognizer::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData)
|
||||
{
|
||||
ASSERT(m_Protocol != nullptr);
|
||||
m_Protocol->SendSpawnObject(a_Entity, a_ObjectType, a_ObjectData, a_Yaw, a_Pitch);
|
||||
m_Protocol->SendSpawnObject(a_Entity, a_ObjectType, a_ObjectData);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
virtual void SendSoundParticleEffect (const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
|
||||
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
|
||||
virtual void SendSpawnMob (const cMonster & a_Mob) override;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData) override;
|
||||
virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override;
|
||||
virtual void SendStatistics (const cStatManager & a_Manager) override;
|
||||
virtual void SendTabCompletionResults (const AStringVector & a_Results) override;
|
||||
|
|
|
@ -1386,7 +1386,7 @@ void cProtocol_1_8_0::SendSpawnMob(const cMonster & a_Mob)
|
|||
|
||||
|
||||
|
||||
void cProtocol_1_8_0::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch)
|
||||
void cProtocol_1_8_0::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData)
|
||||
{
|
||||
ASSERT(m_State == 3); // In game mode?
|
||||
double PosX = a_Entity.GetPosX();
|
||||
|
|
|
@ -106,7 +106,7 @@ public:
|
|||
virtual void SendSoundParticleEffect (const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
|
||||
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
|
||||
virtual void SendSpawnMob (const cMonster & a_Mob) override;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData) override;
|
||||
virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override;
|
||||
virtual void SendStatistics (const cStatManager & a_Manager) override;
|
||||
virtual void SendTabCompletionResults (const AStringVector & a_Results) override;
|
||||
|
|
|
@ -1447,7 +1447,7 @@ void cProtocol_1_9_0::SendSpawnMob(const cMonster & a_Mob)
|
|||
|
||||
|
||||
|
||||
void cProtocol_1_9_0::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch)
|
||||
void cProtocol_1_9_0::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData)
|
||||
{
|
||||
ASSERT(m_State == 3); // In game mode?
|
||||
double PosX = a_Entity.GetPosX();
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
virtual void SendSoundParticleEffect (const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
|
||||
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
|
||||
virtual void SendSpawnMob (const cMonster & a_Mob) override;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override;
|
||||
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData) override;
|
||||
virtual void SendSpawnVehicle (const cEntity & a_Vehicle, char a_VehicleType, char a_VehicleSubType) override;
|
||||
virtual void SendStatistics (const cStatManager & a_Manager) override;
|
||||
virtual void SendTabCompletionResults (const AStringVector & a_Results) override;
|
||||
|
|
Loading…
Reference in New Issue