mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 16:28:28 +00:00
Switched out our kinda juryrigged vector types for glm::vec types since we use that as a 3d math library already but never switched out the types
This commit is contained in:
+44
-44
@@ -49,7 +49,7 @@ Mob::Mob(const char* in_name,
|
||||
uint32 in_npctype_id,
|
||||
float in_size,
|
||||
float in_runspeed,
|
||||
const xyz_heading& position,
|
||||
const glm::vec4& position,
|
||||
uint8 in_light,
|
||||
uint8 in_texture,
|
||||
uint8 in_helmtexture,
|
||||
@@ -99,8 +99,8 @@ Mob::Mob(const char* in_name,
|
||||
gravity_timer(1000),
|
||||
viral_timer(0),
|
||||
m_FearWalkTarget(-999999.0f,-999999.0f,-999999.0f),
|
||||
m_TargetLocation(xyz_location::Origin()),
|
||||
m_TargetV(xyz_location::Origin()),
|
||||
m_TargetLocation(glm::vec3()),
|
||||
m_TargetV(glm::vec3()),
|
||||
flee_timer(FLEE_CHECK_TIMER),
|
||||
m_Position(position)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ Mob::Mob(const char* in_name,
|
||||
AI_Init();
|
||||
SetMoving(false);
|
||||
moved=false;
|
||||
m_RewindLocation = xyz_location::Origin();
|
||||
m_RewindLocation = glm::vec3();
|
||||
move_tic_count = 0;
|
||||
|
||||
_egnode = nullptr;
|
||||
@@ -243,7 +243,7 @@ Mob::Mob(const char* in_name,
|
||||
}
|
||||
}
|
||||
|
||||
m_Delta = xyz_heading::Origin();
|
||||
m_Delta = glm::vec4();
|
||||
animation = 0;
|
||||
|
||||
logging_enabled = false;
|
||||
@@ -316,7 +316,7 @@ Mob::Mob(const char* in_name,
|
||||
wandertype=0;
|
||||
pausetype=0;
|
||||
cur_wp = 0;
|
||||
m_CurrentWayPoint = xyz_heading::Origin();
|
||||
m_CurrentWayPoint = glm::vec4();
|
||||
cur_wp_pause = 0;
|
||||
patrol=0;
|
||||
follow=0;
|
||||
@@ -363,7 +363,7 @@ Mob::Mob(const char* in_name,
|
||||
nimbus_effect3 = 0;
|
||||
m_targetable = true;
|
||||
|
||||
m_TargetRing = xyz_location::Origin();
|
||||
m_TargetRing = glm::vec3();
|
||||
|
||||
flymode = FlyMode3;
|
||||
// Pathing
|
||||
@@ -882,10 +882,10 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName));
|
||||
}
|
||||
|
||||
ns->spawn.heading = FloatToEQ19(m_Position.m_Heading);
|
||||
ns->spawn.x = FloatToEQ19(m_Position.m_X);//((int32)x_pos)<<3;
|
||||
ns->spawn.y = FloatToEQ19(m_Position.m_Y);//((int32)y_pos)<<3;
|
||||
ns->spawn.z = FloatToEQ19(m_Position.m_Z);//((int32)z_pos)<<3;
|
||||
ns->spawn.heading = FloatToEQ19(m_Position.w);
|
||||
ns->spawn.x = FloatToEQ19(m_Position.x);//((int32)x_pos)<<3;
|
||||
ns->spawn.y = FloatToEQ19(m_Position.y);//((int32)y_pos)<<3;
|
||||
ns->spawn.z = FloatToEQ19(m_Position.z);//((int32)z_pos)<<3;
|
||||
ns->spawn.spawnId = GetID();
|
||||
ns->spawn.curHp = static_cast<uint8>(GetHPRatio());
|
||||
ns->spawn.max_hp = 100; //this field needs a better name
|
||||
@@ -1210,13 +1210,13 @@ void Mob::SendPosUpdate(uint8 iSendToSelf) {
|
||||
void Mob::MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct *spu){
|
||||
memset(spu,0xff,sizeof(PlayerPositionUpdateServer_Struct));
|
||||
spu->spawn_id = GetID();
|
||||
spu->x_pos = FloatToEQ19(m_Position.m_X);
|
||||
spu->y_pos = FloatToEQ19(m_Position.m_Y);
|
||||
spu->z_pos = FloatToEQ19(m_Position.m_Z);
|
||||
spu->x_pos = FloatToEQ19(m_Position.x);
|
||||
spu->y_pos = FloatToEQ19(m_Position.y);
|
||||
spu->z_pos = FloatToEQ19(m_Position.z);
|
||||
spu->delta_x = NewFloatToEQ13(0);
|
||||
spu->delta_y = NewFloatToEQ13(0);
|
||||
spu->delta_z = NewFloatToEQ13(0);
|
||||
spu->heading = FloatToEQ19(m_Position.m_Heading);
|
||||
spu->heading = FloatToEQ19(m_Position.w);
|
||||
spu->animation = 0;
|
||||
spu->delta_heading = NewFloatToEQ13(0);
|
||||
spu->padding0002 =0;
|
||||
@@ -1229,13 +1229,13 @@ void Mob::MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct *spu){
|
||||
// this is for SendPosUpdate()
|
||||
void Mob::MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu) {
|
||||
spu->spawn_id = GetID();
|
||||
spu->x_pos = FloatToEQ19(m_Position.m_X);
|
||||
spu->y_pos = FloatToEQ19(m_Position.m_Y);
|
||||
spu->z_pos = FloatToEQ19(m_Position.m_Z);
|
||||
spu->delta_x = NewFloatToEQ13(m_Delta.m_X);
|
||||
spu->delta_y = NewFloatToEQ13(m_Delta.m_Y);
|
||||
spu->delta_z = NewFloatToEQ13(m_Delta.m_Z);
|
||||
spu->heading = FloatToEQ19(m_Position.m_Heading);
|
||||
spu->x_pos = FloatToEQ19(m_Position.x);
|
||||
spu->y_pos = FloatToEQ19(m_Position.y);
|
||||
spu->z_pos = FloatToEQ19(m_Position.z);
|
||||
spu->delta_x = NewFloatToEQ13(m_Delta.x);
|
||||
spu->delta_y = NewFloatToEQ13(m_Delta.y);
|
||||
spu->delta_z = NewFloatToEQ13(m_Delta.z);
|
||||
spu->heading = FloatToEQ19(m_Position.w);
|
||||
spu->padding0002 =0;
|
||||
spu->padding0006 =7;
|
||||
spu->padding0014 =0x7f;
|
||||
@@ -1244,7 +1244,7 @@ void Mob::MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu) {
|
||||
spu->animation = animation;
|
||||
else
|
||||
spu->animation = pRunAnimSpeed;//animation;
|
||||
spu->delta_heading = NewFloatToEQ13(m_Delta.m_Heading);
|
||||
spu->delta_heading = NewFloatToEQ13(m_Delta.w);
|
||||
}
|
||||
|
||||
void Mob::ShowStats(Client* client)
|
||||
@@ -1360,11 +1360,11 @@ void Mob::GMMove(float x, float y, float z, float heading, bool SendUpdate) {
|
||||
entity_list.ProcessMove(CastToNPC(), x, y, z);
|
||||
}
|
||||
|
||||
m_Position.m_X = x;
|
||||
m_Position.m_Y = y;
|
||||
m_Position.m_Z = z;
|
||||
if (m_Position.m_Heading != 0.01)
|
||||
this->m_Position.m_Heading = heading;
|
||||
m_Position.x = x;
|
||||
m_Position.y = y;
|
||||
m_Position.z = z;
|
||||
if (m_Position.w != 0.01)
|
||||
this->m_Position.w = heading;
|
||||
if(IsNPC())
|
||||
CastToNPC()->SaveGuardSpot(true);
|
||||
if(SendUpdate)
|
||||
@@ -2408,7 +2408,7 @@ bool Mob::HateSummon() {
|
||||
entity_list.MessageClose(this, true, 500, MT_Say, "%s says,'You will not evade me, %s!' ", GetCleanName(), target->GetCleanName() );
|
||||
|
||||
if (target->IsClient()) {
|
||||
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Position.m_X, m_Position.m_Y, m_Position.m_Z, target->GetHeading(), 0, SummonPC);
|
||||
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Position.x, m_Position.y, m_Position.z, target->GetHeading(), 0, SummonPC);
|
||||
}
|
||||
else {
|
||||
#ifdef BOTS
|
||||
@@ -2419,7 +2419,7 @@ bool Mob::HateSummon() {
|
||||
|
||||
}
|
||||
#endif //BOTS
|
||||
target->GMMove(m_Position.m_X, m_Position.m_Y, m_Position.m_Z, target->GetHeading());
|
||||
target->GMMove(m_Position.x, m_Position.y, m_Position.z, target->GetHeading());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2833,12 +2833,12 @@ void Mob::SetNextIncHPEvent( int inchpevent )
|
||||
nextinchpevent = inchpevent;
|
||||
}
|
||||
//warp for quest function,from sandy
|
||||
void Mob::Warp(const xyz_location& location)
|
||||
void Mob::Warp(const glm::vec3& location)
|
||||
{
|
||||
if(IsNPC())
|
||||
entity_list.ProcessMove(CastToNPC(), location.m_X, location.m_Y, location.m_Z);
|
||||
entity_list.ProcessMove(CastToNPC(), location.x, location.y, location.z);
|
||||
|
||||
m_Position = location;
|
||||
m_Position = glm::vec4(location, m_Position.w);
|
||||
|
||||
Mob* target = GetTarget();
|
||||
if (target)
|
||||
@@ -3055,11 +3055,11 @@ float Mob::FindGroundZ(float new_x, float new_y, float z_offset)
|
||||
float ret = -999999;
|
||||
if (zone->zonemap != nullptr)
|
||||
{
|
||||
Map::Vertex me;
|
||||
me.x = m_Position.m_X;
|
||||
me.y = m_Position.m_Y;
|
||||
me.z = m_Position.m_Z + z_offset;
|
||||
Map::Vertex hit;
|
||||
glm::vec3 me;
|
||||
me.x = m_Position.x;
|
||||
me.y = m_Position.y;
|
||||
me.z = m_Position.z + z_offset;
|
||||
glm::vec3 hit;
|
||||
float best_z = zone->zonemap->FindBestZ(me, &hit);
|
||||
if (best_z != -999999)
|
||||
{
|
||||
@@ -3075,11 +3075,11 @@ float Mob::GetGroundZ(float new_x, float new_y, float z_offset)
|
||||
float ret = -999999;
|
||||
if (zone->zonemap != 0)
|
||||
{
|
||||
Map::Vertex me;
|
||||
me.x = m_Position.m_X;
|
||||
me.y = m_Position.m_Y;
|
||||
me.z = m_Position.m_Z+z_offset;
|
||||
Map::Vertex hit;
|
||||
glm::vec3 me;
|
||||
me.x = m_Position.x;
|
||||
me.y = m_Position.y;
|
||||
me.z = m_Position.z+z_offset;
|
||||
glm::vec3 hit;
|
||||
float best_z = zone->zonemap->FindBestZ(me, &hit);
|
||||
if (best_z != -999999)
|
||||
{
|
||||
@@ -3173,7 +3173,7 @@ void Mob::TriggerDefensiveProcs(const ItemInst* weapon, Mob *on, uint16 hand, in
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::SetDelta(const xyz_heading& delta) {
|
||||
void Mob::SetDelta(const glm::vec4& delta) {
|
||||
m_Delta = delta;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user