heading, x_pos, y_pos, and z_pos replaced with m_Position in Mob

This commit is contained in:
Arthur Ice 2014-11-25 20:16:04 -08:00
parent 640aea24bc
commit 53602e3c61
13 changed files with 318 additions and 319 deletions

View File

@ -58,10 +58,10 @@ Beacon::Beacon(Mob *at_mob, int lifetime)
caster_id = 0;
// copy location
x_pos = at_mob->GetX();
y_pos = at_mob->GetY();
z_pos = at_mob->GetZ();
heading = at_mob->GetHeading();
m_Position.m_X = at_mob->GetX();
m_Position.m_Y = at_mob->GetY();
m_Position.m_Z = at_mob->GetZ();
m_Position.m_Heading = at_mob->GetHeading();
if(lifetime)
{

View File

@ -4122,9 +4122,9 @@ void Bot::Spawn(Client* botCharacterOwner, std::string* errorMessage) {
this->GetBotOwner()->CastToClient()->Message(13, "%s save failed!", this->GetCleanName());
// Spawn the bot at the bow owner's loc
this->x_pos = botCharacterOwner->GetX();
this->y_pos = botCharacterOwner->GetY();
this->z_pos = botCharacterOwner->GetZ();
this->m_Position.m_X = botCharacterOwner->GetX();
this->m_Position.m_Y = botCharacterOwner->GetY();
this->m_Position.m_Z = botCharacterOwner->GetZ();
// Make the bot look at the bot owner
FaceTarget(botCharacterOwner);

View File

@ -399,9 +399,9 @@ Client::~Client() {
{
m_pp.zone_id = m_pp.binds[0].zoneId;
m_pp.zoneInstance = m_pp.binds[0].instance_id;
x_pos = m_pp.binds[0].x;
y_pos = m_pp.binds[0].y;
z_pos = m_pp.binds[0].z;
m_Position.m_X = m_pp.binds[0].x;
m_Position.m_Y = m_pp.binds[0].y;
m_Position.m_Z = m_pp.binds[0].z;
}
// we save right now, because the client might be zoning and the world
@ -525,11 +525,11 @@ bool Client::Save(uint8 iCommitNow) {
return false;
/* Wrote current basics to PP for saves */
m_pp.x = x_pos;
m_pp.y = y_pos;
m_pp.z = z_pos;
m_pp.x = m_Position.m_X;
m_pp.y = m_Position.m_Y;
m_pp.z = m_Position.m_Z;
m_pp.guildrank = guildrank;
m_pp.heading = heading;
m_pp.heading = m_Position.m_Heading;
/* Mana and HP */
if (GetHP() <= 0) {

View File

@ -1472,10 +1472,10 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
/* Set Mob variables for spawn */
class_ = m_pp.class_;
level = m_pp.level;
x_pos = m_pp.x;
y_pos = m_pp.y;
z_pos = m_pp.z;
heading = m_pp.heading;
m_Position.m_X = m_pp.x;
m_Position.m_Y = m_pp.y;
m_Position.m_Z = m_pp.z;
m_Position.m_Heading = m_pp.heading;
race = m_pp.race;
base_race = m_pp.race;
gender = m_pp.gender;
@ -4380,9 +4380,9 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
float dist = 0;
float tmp;
tmp = x_pos - ppu->x_pos;
tmp = m_Position.m_X - ppu->x_pos;
dist += tmp*tmp;
tmp = y_pos - ppu->y_pos;
tmp = m_Position.m_Y - ppu->y_pos;
dist += tmp*tmp;
dist = sqrt(dist);
@ -4534,9 +4534,9 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
//If the player has moved more than units for x or y, then we'll store
//his pre-PPU x and y for /rewind, in case he gets stuck.
if ((rewind_x_diff > 750) || (rewind_y_diff > 750)) {
rewind_x = x_pos;
rewind_y = y_pos;
rewind_z = z_pos;
rewind_x = m_Position.m_X;
rewind_y = m_Position.m_Y;
rewind_z = m_Position.m_Z;
}
//If the PPU was a large jump, such as a cross zone gate or Call of Hero,
@ -4563,13 +4563,13 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
delta_z = ppu->delta_z;
delta_heading = ppu->delta_heading;
if(IsTracking() && ((x_pos!=ppu->x_pos) || (y_pos!=ppu->y_pos))){
if(IsTracking() && ((m_Position.m_X!=ppu->x_pos) || (m_Position.m_Y!=ppu->y_pos))){
if(MakeRandomFloat(0, 100) < 70)//should be good
CheckIncreaseSkill(SkillTracking, nullptr, -20);
}
// Break Hide if moving without sneaking and set rewind timer if moved
if(ppu->y_pos != y_pos || ppu->x_pos != x_pos){
if(ppu->y_pos != m_Position.m_Y || ppu->x_pos != m_Position.m_X){
if((hidden || improved_hidden) && !sneaking){
hidden = false;
improved_hidden = false;
@ -4589,13 +4589,14 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
// Outgoing client packet
float tmpheading = EQ19toFloat(ppu->heading);
if (!FCMP(ppu->y_pos, y_pos) || !FCMP(ppu->x_pos, x_pos) || !FCMP(tmpheading, heading) || ppu->animation != animation)
if (!FCMP(ppu->y_pos, m_Position.m_Y) || !FCMP(ppu->x_pos, m_Position.m_X) || !FCMP(tmpheading, m_Position.m_Heading) || ppu->animation != animation)
{
x_pos = ppu->x_pos;
y_pos = ppu->y_pos;
z_pos = ppu->z_pos;
m_Position.m_X = ppu->x_pos;
m_Position.m_Y = ppu->y_pos;
m_Position.m_Z = ppu->z_pos;
m_Position.m_Heading = tmpheading;
animation = ppu->animation;
heading = tmpheading;
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
PlayerPositionUpdateServer_Struct* ppu = (PlayerPositionUpdateServer_Struct*)outapp->pBuffer;
@ -4609,7 +4610,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
if(zone->watermap)
{
if(zone->watermap->InLiquid(x_pos, y_pos, z_pos))
if(zone->watermap->InLiquid(m_Position.m_X, m_Position.m_Y, m_Position.m_Z))
{
CheckIncreaseSkill(SkillSwimming, nullptr, -17);
}

View File

@ -2144,9 +2144,9 @@ void Client::HandleRespawnFromHover(uint32 Option)
if (corpse)
{
x_pos = corpse->GetX();
y_pos = corpse->GetY();
z_pos = corpse->GetZ();
m_Position.m_X = corpse->GetX();
m_Position.m_Y = corpse->GetY();
m_Position.m_Z = corpse->GetZ();
}
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ZonePlayerToBind, sizeof(ZonePlayerToBind_Struct) + 10);
@ -2199,10 +2199,10 @@ void Client::HandleRespawnFromHover(uint32 Option)
SetMana(GetMaxMana());
SetEndurance(GetMaxEndurance());
x_pos = chosen->x;
y_pos = chosen->y;
z_pos = chosen->z;
heading = chosen->heading;
m_Position.m_X = chosen->x;
m_Position.m_Y = chosen->y;
m_Position.m_Z = chosen->z;
m_Position.m_Heading = chosen->heading;
ClearHover();
entity_list.RefreshClientXTargets(this);

View File

@ -597,11 +597,11 @@ bool Corpse::Save() {
/* Create New Corpse*/
if (corpse_db_id == 0) {
corpse_db_id = database.SaveCharacterCorpse(char_id, orgname, zone->GetZoneID(), zone->GetInstanceID(), dbpc, x_pos, y_pos, z_pos, heading);
corpse_db_id = database.SaveCharacterCorpse(char_id, orgname, zone->GetZoneID(), zone->GetInstanceID(), dbpc, m_Position.m_X, m_Position.m_Y, m_Position.m_Z, m_Position.m_Heading);
}
/* Update Corpse Data */
else{
corpse_db_id = database.UpdateCharacterCorpse(corpse_db_id, char_id, orgname, zone->GetZoneID(), zone->GetInstanceID(), dbpc, x_pos, y_pos, z_pos, heading, IsRezzed());
corpse_db_id = database.UpdateCharacterCorpse(corpse_db_id, char_id, orgname, zone->GetZoneID(), zone->GetInstanceID(), dbpc, m_Position.m_X, m_Position.m_Y, m_Position.m_Z, m_Position.m_Heading, IsRezzed());
}
safe_delete_array(dbpc);

View File

@ -225,15 +225,15 @@ bool Client::CanFish() {
HeadingDegrees = (int) ((GetHeading()*360)/256);
HeadingDegrees = HeadingDegrees % 360;
RodX = x_pos + RodLength * sin(HeadingDegrees * M_PI/180.0f);
RodY = y_pos + RodLength * cos(HeadingDegrees * M_PI/180.0f);
RodX = m_Position.m_X + RodLength * sin(HeadingDegrees * M_PI/180.0f);
RodY = m_Position.m_Y + RodLength * cos(HeadingDegrees * M_PI/180.0f);
// Do BestZ to find where the line hanging from the rod intersects the water (if it is water).
// and go 1 unit into the water.
Map::Vertex dest;
dest.x = RodX;
dest.y = RodY;
dest.z = z_pos+10;
dest.z = m_Position.m_Z+10;
RodZ = zone->zonemap->FindBestZ(dest, nullptr) + 4;
bool in_lava = zone->watermap->InLava(RodX, RodY, RodZ);
@ -243,7 +243,7 @@ bool Client::CanFish() {
Message_StringID(MT_Skills, FISHING_LAVA); //Trying to catch a fire elemental or something?
return false;
}
if((!in_water) || (z_pos-RodZ)>LineLength) { //Didn't hit the water OR the water is too far below us
if((!in_water) || (m_Position.m_Z-RodZ)>LineLength) { //Didn't hit the water OR the water is too far below us
Message_StringID(MT_Skills, FISHING_LAND); //Trying to catch land sharks perhaps?
return false;
}

View File

@ -157,10 +157,10 @@ Mob::Mob(const char* in_name,
if (runspeed < 0 || runspeed > 20)
runspeed = 1.25f;
heading = in_heading;
x_pos = in_x_pos;
y_pos = in_y_pos;
z_pos = in_z_pos;
m_Position.m_Heading = in_heading;
m_Position.m_X = in_x_pos;
m_Position.m_Y = in_y_pos;
m_Position.m_Z = in_z_pos;
light = in_light;
texture = in_texture;
helmtexture = in_helmtexture;
@ -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(heading);
ns->spawn.x = FloatToEQ19(x_pos);//((int32)x_pos)<<3;
ns->spawn.y = FloatToEQ19(y_pos);//((int32)y_pos)<<3;
ns->spawn.z = FloatToEQ19(z_pos);//((int32)z_pos)<<3;
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.spawnId = GetID();
ns->spawn.curHp = static_cast<uint8>(GetHPRatio());
ns->spawn.max_hp = 100; //this field needs a better name
@ -1211,13 +1211,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(x_pos);
spu->y_pos = FloatToEQ19(y_pos);
spu->z_pos = FloatToEQ19(z_pos);
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(0);
spu->delta_y = NewFloatToEQ13(0);
spu->delta_z = NewFloatToEQ13(0);
spu->heading = FloatToEQ19(heading);
spu->heading = FloatToEQ19(m_Position.m_Heading);
spu->animation = 0;
spu->delta_heading = NewFloatToEQ13(0);
spu->padding0002 =0;
@ -1230,13 +1230,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(x_pos);
spu->y_pos = FloatToEQ19(y_pos);
spu->z_pos = FloatToEQ19(z_pos);
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(delta_x);
spu->delta_y = NewFloatToEQ13(delta_y);
spu->delta_z = NewFloatToEQ13(delta_z);
spu->heading = FloatToEQ19(heading);
spu->heading = FloatToEQ19(m_Position.m_Heading);
spu->padding0002 =0;
spu->padding0006 =7;
spu->padding0014 =0x7f;
@ -1361,11 +1361,11 @@ void Mob::GMMove(float x, float y, float z, float heading, bool SendUpdate) {
entity_list.ProcessMove(CastToNPC(), x, y, z);
}
x_pos = x;
y_pos = y;
z_pos = z;
if (heading != 0.01)
this->heading = heading;
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;
if(IsNPC())
CastToNPC()->SaveGuardSpot(true);
if(SendUpdate)
@ -2062,9 +2062,9 @@ bool Mob::CanThisClassBlock(void) const
}
float Mob::Dist(const Mob &other) const {
float xDiff = other.x_pos - x_pos;
float yDiff = other.y_pos - y_pos;
float zDiff = other.z_pos - z_pos;
float xDiff = other.m_Position.m_X - m_Position.m_X;
float yDiff = other.m_Position.m_Y - m_Position.m_Y;
float zDiff = other.m_Position.m_Z - m_Position.m_Z;
return sqrtf( (xDiff * xDiff)
+ (yDiff * yDiff)
@ -2072,17 +2072,17 @@ float Mob::Dist(const Mob &other) const {
}
float Mob::DistNoZ(const Mob &other) const {
float xDiff = other.x_pos - x_pos;
float yDiff = other.y_pos - y_pos;
float xDiff = other.m_Position.m_X - m_Position.m_X;
float yDiff = other.m_Position.m_Y - m_Position.m_Y;
return sqrtf( (xDiff * xDiff)
+ (yDiff * yDiff) );
}
float Mob::DistNoRoot(const Mob &other) const {
float xDiff = other.x_pos - x_pos;
float yDiff = other.y_pos - y_pos;
float zDiff = other.z_pos - z_pos;
float xDiff = other.m_Position.m_X - m_Position.m_X;
float yDiff = other.m_Position.m_Y - m_Position.m_Y;
float zDiff = other.m_Position.m_Z - m_Position.m_Z;
return ( (xDiff * xDiff)
+ (yDiff * yDiff)
@ -2090,9 +2090,9 @@ float Mob::DistNoRoot(const Mob &other) const {
}
float Mob::DistNoRoot(float x, float y, float z) const {
float xDiff = x - x_pos;
float yDiff = y - y_pos;
float zDiff = z - z_pos;
float xDiff = x - m_Position.m_X;
float yDiff = y - m_Position.m_Y;
float zDiff = z - m_Position.m_Z;
return ( (xDiff * xDiff)
+ (yDiff * yDiff)
@ -2100,15 +2100,15 @@ float Mob::DistNoRoot(float x, float y, float z) const {
}
float Mob::DistNoRootNoZ(float x, float y) const {
float xDiff = x - x_pos;
float yDiff = y - y_pos;
float xDiff = x - m_Position.m_X;
float yDiff = y - m_Position.m_Y;
return ( (xDiff * xDiff) + (yDiff * yDiff) );
}
float Mob::DistNoRootNoZ(const Mob &other) const {
float xDiff = other.x_pos - x_pos;
float yDiff = other.y_pos - y_pos;
float xDiff = other.m_Position.m_X - m_Position.m_X;
float yDiff = other.m_Position.m_Y - m_Position.m_Y;
return ( (xDiff * xDiff) + (yDiff * yDiff) );
}
@ -2253,7 +2253,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(), x_pos, y_pos, z_pos, target->GetHeading(), 0, SummonPC);
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Position.m_X, m_Position.m_Y, m_Position.m_Z, target->GetHeading(), 0, SummonPC);
}
else {
#ifdef BOTS
@ -2266,7 +2266,7 @@ bool Mob::HateSummon() {
}
#endif //BOTS
target->GMMove(x_pos, y_pos, z_pos, target->GetHeading());
target->GMMove(m_Position.m_X, m_Position.m_Y, m_Position.m_Z, target->GetHeading());
}
return true;
@ -2614,9 +2614,9 @@ void Mob::Warp( float x, float y, float z )
entity_list.ProcessMove(CastToNPC(), x, y, z);
}
x_pos = x;
y_pos = y;
z_pos = z;
m_Position.m_X = x;
m_Position.m_Y = y;
m_Position.m_Z = z;
Mob* target = GetTarget();
if (target) {
@ -2829,9 +2829,9 @@ float Mob::FindGroundZ(float new_x, float new_y, float z_offset)
if (zone->zonemap != nullptr)
{
Map::Vertex me;
me.x = new_x;
me.y = new_y;
me.z = z_pos+z_offset;
me.x = m_Position.m_X;
me.y = m_Position.m_Y;
me.z = m_Position.m_Z + z_offset;
Map::Vertex hit;
float best_z = zone->zonemap->FindBestZ(me, &hit);
if (best_z != -999999)
@ -2849,9 +2849,9 @@ float Mob::GetGroundZ(float new_x, float new_y, float z_offset)
if (zone->zonemap != 0)
{
Map::Vertex me;
me.x = new_x;
me.y = new_y;
me.z = z_pos+z_offset;
me.x = m_Position.m_X;
me.y = m_Position.m_Y;
me.z = m_Position.m_Z+z_offset;
Map::Vertex hit;
float best_z = zone->zonemap->FindBestZ(me, &hit);
if (best_z != -999999)

View File

@ -23,6 +23,7 @@
#include "entity.h"
#include "hate_list.h"
#include "pathing.h"
#include "position.h"
#include <set>
#include <vector>
#include <string>
@ -392,10 +393,10 @@ public:
((static_cast<float>(cur_mana) / max_mana) * 100); }
virtual int32 CalcMaxMana();
uint32 GetNPCTypeID() const { return npctype_id; }
inline const float GetX() const { return x_pos; }
inline const float GetY() const { return y_pos; }
inline const float GetZ() const { return z_pos; }
inline const float GetHeading() const { return heading; }
inline const float GetX() const { return m_Position.m_X; }
inline const float GetY() const { return m_Position.m_Y; }
inline const float GetZ() const { return m_Position.m_Z; }
inline const float GetHeading() const { return m_Position.m_Heading; }
inline const float GetSize() const { return size; }
inline const float GetBaseSize() const { return base_size; }
inline const float GetTarX() const { return tarx; }
@ -437,8 +438,8 @@ public:
void MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu);
void SendPosition();
void SetFlyMode(uint8 flymode);
inline void Teleport(Map::Vertex NewPosition) { x_pos = NewPosition.x; y_pos = NewPosition.y;
z_pos = NewPosition.z; };
inline void Teleport(Map::Vertex NewPosition) { m_Position.m_X = NewPosition.x; m_Position.m_Y = NewPosition.y;
m_Position.m_Z = NewPosition.z; };
//AI
static uint32 GetLevelCon(uint8 mylevel, uint8 iOtherLevel);
@ -459,8 +460,8 @@ public:
bool IsEngaged() { return(!hate_list.IsEmpty()); }
bool HateSummon();
void FaceTarget(Mob* MobToFace = 0);
void SetHeading(float iHeading) { if(heading != iHeading) { pLastChange = Timer::GetCurrentTime();
heading = iHeading; } }
void SetHeading(float iHeading) { if(m_Position.m_Heading != iHeading) { pLastChange = Timer::GetCurrentTime();
m_Position.m_Heading = iHeading; } }
void WipeHateList();
void AddFeignMemory(Client* attacker);
void RemoveFromFeignMemory(Client* attacker);
@ -806,7 +807,7 @@ public:
void SetDontCureMeBefore(uint32 time) { pDontCureMeBefore = time; }
// calculate interruption of spell via movement of mob
void SaveSpellLoc() {spell_x = x_pos; spell_y = y_pos; spell_z = z_pos; }
void SaveSpellLoc() {spell_x = m_Position.m_X; spell_y = m_Position.m_Y; spell_z = m_Position.m_Z; }
inline float GetSpellX() const {return spell_x;}
inline float GetSpellY() const {return spell_y;}
inline float GetSpellZ() const {return spell_z;}
@ -998,10 +999,7 @@ protected:
uint8 level;
uint8 orig_level;
uint32 npctype_id;
float x_pos;
float y_pos;
float z_pos;
float heading;
xyz_heading m_Position;
uint16 animation;
float base_size;
float size;

View File

@ -1792,7 +1792,7 @@ void NPC::AI_DoMovement() {
CP2Moved = CalculateNewPosition2(guard_x, guard_y, guard_z, walksp);
else
{
if(!((x_pos == guard_x) && (y_pos == guard_y) && (z_pos == guard_z)))
if(!((m_Position.m_X == guard_x) && (m_Position.m_Y == guard_y) && (m_Position.m_Z == guard_z)))
{
bool WaypointChanged, NodeReached;
Map::Vertex Goal = UpdatePath(guard_x, guard_y, guard_z, walksp, WaypointChanged, NodeReached);

View File

@ -3831,9 +3831,9 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster)
rezz->zone_id = zone->GetZoneID();
rezz->instance_id = zone->GetInstanceID();
rezz->spellid = spellid;
rezz->x = this->x_pos;
rezz->y = this->y_pos;
rezz->z = this->z_pos;
rezz->x = this->m_Position.m_X;
rezz->y = this->m_Position.m_Y;
rezz->z = this->m_Position.m_Z;
rezz->unknown000 = 0x00000000;
rezz->unknown020 = 0x00000000;
rezz->unknown088 = 0x00000000;

View File

@ -437,10 +437,10 @@ void NPC::SaveGuardSpot(bool iClearGuardSpot) {
guard_heading = 0;
}
else {
guard_x = x_pos;
guard_y = y_pos;
guard_z = z_pos;
guard_heading = heading;
guard_x = m_Position.m_X;
guard_y = m_Position.m_Y;
guard_z = m_Position.m_Z;
guard_heading = m_Position.m_Heading;
if(guard_heading == 0)
guard_heading = 0.0001; //hack to make IsGuarding simpler
mlog(AI__WAYPOINTS, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z);
@ -452,7 +452,7 @@ void NPC::NextGuardPosition() {
SetHeading(guard_heading);
mlog(AI__WAYPOINTS, "Unable to move to next guard position. Probably rooted.");
}
else if((x_pos == guard_x) && (y_pos == guard_y) && (z_pos == guard_z))
else if((m_Position.m_X == guard_x) && (m_Position.m_Y == guard_y) && (m_Position.m_Z == guard_z))
{
if(moved)
{
@ -480,7 +480,7 @@ void Mob::SaveSpawnSpot() {
}*/
float Mob::CalculateDistance(float x, float y, float z) {
return (float)sqrtf( ((x_pos-x)*(x_pos-x)) + ((y_pos-y)*(y_pos-y)) + ((z_pos-z)*(z_pos-z)) );
return (float)sqrtf( ((m_Position.m_X-x)*(m_Position.m_X-x)) + ((m_Position.m_Y-y)*(m_Position.m_Y-y)) + ((m_Position.m_Z-z)*(m_Position.m_Z-z)) );
}
/*
@ -491,13 +491,13 @@ uint8 NPC::CalculateHeadingToNextWaypoint() {
float Mob::CalculateHeadingToTarget(float in_x, float in_y) {
float angle;
if (in_x-x_pos > 0)
angle = - 90 + atan((float)(in_y-y_pos) / (float)(in_x-x_pos)) * 180 / M_PI;
else if (in_x-x_pos < 0)
angle = + 90 + atan((float)(in_y-y_pos) / (float)(in_x-x_pos)) * 180 / M_PI;
if (in_x-m_Position.m_X > 0)
angle = - 90 + atan((float)(in_y-m_Position.m_Y) / (float)(in_x-m_Position.m_X)) * 180 / M_PI;
else if (in_x-m_Position.m_X < 0)
angle = + 90 + atan((float)(in_y-m_Position.m_Y) / (float)(in_x-m_Position.m_X)) * 180 / M_PI;
else // Added?
{
if (in_y-y_pos > 0)
if (in_y-m_Position.m_Y > 0)
angle = 0;
else
angle = 180;
@ -513,16 +513,16 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
if(GetID()==0)
return true;
if ((x_pos-x == 0) && (y_pos-y == 0)) {//spawn is at target coords
if(z_pos-z != 0) {
z_pos = z;
if ((m_Position.m_X-x == 0) && (m_Position.m_Y-y == 0)) {//spawn is at target coords
if(m_Position.m_Z-z != 0) {
m_Position.m_Z = z;
mlog(AI__WAYPOINTS, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z);
return true;
}
mlog(AI__WAYPOINTS, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater);
return false;
}
else if ((ABS(x_pos - x) < 0.1) && (ABS(y_pos - y) < 0.1))
else if ((ABS(m_Position.m_X - x) < 0.1) && (ABS(m_Position.m_Y - y) < 0.1))
{
mlog(AI__WAYPOINTS, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z);
@ -530,25 +530,25 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
entity_list.ProcessMove(CastToNPC(), x, y, z);
}
x_pos = x;
y_pos = y;
z_pos = z;
m_Position.m_X = x;
m_Position.m_Y = y;
m_Position.m_Z = z;
return true;
}
int compare_steps = IsBoat() ? 1 : 20;
if(tar_ndx < compare_steps && tarx==x && tary==y) {
float new_x = x_pos + tar_vx*tar_vector;
float new_y = y_pos + tar_vy*tar_vector;
float new_z = z_pos + tar_vz*tar_vector;
float new_x = m_Position.m_X + tar_vx*tar_vector;
float new_y = m_Position.m_Y + tar_vy*tar_vector;
float new_z = m_Position.m_Z + tar_vz*tar_vector;
if(IsNPC()) {
entity_list.ProcessMove(CastToNPC(), new_x, new_y, new_z);
}
x_pos = new_x;
y_pos = new_y;
z_pos = new_z;
m_Position.m_X = new_x;
m_Position.m_Y = new_y;
m_Position.m_Z = new_z;
mlog(AI__WAYPOINTS, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz);
@ -563,25 +563,25 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
if(!NPCFlyMode && checkZ && zone->HasMap() && RuleB(Map, FixPathingZWhenMoving))
{
if(!RuleB(Watermap, CheckForWaterWhenMoving) || !zone->HasWaterMap() ||
(zone->HasWaterMap() && !zone->watermap->InWater(x_pos, y_pos, z_pos)))
(zone->HasWaterMap() && !zone->watermap->InWater(m_Position.m_X, m_Position.m_Y, m_Position.m_Z)))
{
Map::Vertex dest(x_pos, y_pos, z_pos);
Map::Vertex dest(m_Position.m_X, m_Position.m_Y, m_Position.m_Z);
float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f;
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,m_Position.m_X,m_Position.m_Y,m_Position.m_Z);
if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check.
{
if((ABS(x - x_pos) < 0.5) && (ABS(y - y_pos) < 0.5))
if((ABS(x - m_Position.m_X) < 0.5) && (ABS(y - m_Position.m_Y) < 0.5))
{
if(ABS(z-z_pos) <= RuleR(Map, FixPathingZMaxDeltaMoving))
z_pos = z;
if(ABS(z-m_Position.m_Z) <= RuleR(Map, FixPathingZMaxDeltaMoving))
m_Position.m_Z = z;
else
z_pos = newz + 1;
m_Position.m_Z = newz + 1;
}
else
z_pos = newz + 1;
m_Position.m_Z = newz + 1;
}
}
}
@ -600,9 +600,9 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
tary=y;
tarz=z;
float nx = this->x_pos;
float ny = this->y_pos;
float nz = this->z_pos;
float nx = this->m_Position.m_X;
float ny = this->m_Position.m_Y;
float nz = this->m_Position.m_Z;
// float nh = this->heading;
tar_vx = x - nx;
@ -635,19 +635,19 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
tar_vy = tar_vy/numsteps;
tar_vz = tar_vz/numsteps;
float new_x = x_pos + tar_vx;
float new_y = y_pos + tar_vy;
float new_z = z_pos + tar_vz;
float new_x = m_Position.m_X + tar_vx;
float new_y = m_Position.m_Y + tar_vy;
float new_z = m_Position.m_Z + tar_vz;
if(IsNPC()) {
entity_list.ProcessMove(CastToNPC(), new_x, new_y, new_z);
}
x_pos = new_x;
y_pos = new_y;
z_pos = new_z;
m_Position.m_X = new_x;
m_Position.m_Y = new_y;
m_Position.m_Z = new_z;
m_Position.m_Heading = CalculateHeadingToTarget(x, y);
tar_ndx=22-numsteps;
heading = CalculateHeadingToTarget(x, y);
mlog(AI__WAYPOINTS, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps);
mlog(AI__WAYPOINTS, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", m_Position.m_X, m_Position.m_Y, m_Position.m_Z, numsteps);
}
else
{
@ -655,9 +655,9 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
entity_list.ProcessMove(CastToNPC(), x, y, z);
}
x_pos = x;
y_pos = y;
z_pos = z;
m_Position.m_X = x;
m_Position.m_Y = y;
m_Position.m_Z = z;
mlog(AI__WAYPOINTS, "Only a single step to get there... jumping.");
@ -667,18 +667,18 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
else {
tar_vector/=20;
float new_x = x_pos + tar_vx*tar_vector;
float new_y = y_pos + tar_vy*tar_vector;
float new_z = z_pos + tar_vz*tar_vector;
float new_x = m_Position.m_X + tar_vx*tar_vector;
float new_y = m_Position.m_Y + tar_vy*tar_vector;
float new_z = m_Position.m_Z + tar_vz*tar_vector;
if(IsNPC()) {
entity_list.ProcessMove(CastToNPC(), new_x, new_y, new_z);
}
x_pos = new_x;
y_pos = new_y;
z_pos = new_z;
heading = CalculateHeadingToTarget(x, y);
mlog(AI__WAYPOINTS, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps);
m_Position.m_X = new_x;
m_Position.m_Y = new_y;
m_Position.m_Z = new_z;
m_Position.m_Heading = CalculateHeadingToTarget(x, y);
mlog(AI__WAYPOINTS, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", m_Position.m_X, m_Position.m_Y, m_Position.m_Z, numsteps);
}
uint8 NPCFlyMode = 0;
@ -692,25 +692,25 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
if(!NPCFlyMode && checkZ && zone->HasMap() && RuleB(Map, FixPathingZWhenMoving)) {
if(!RuleB(Watermap, CheckForWaterWhenMoving) || !zone->HasWaterMap() ||
(zone->HasWaterMap() && !zone->watermap->InWater(x_pos, y_pos, z_pos)))
(zone->HasWaterMap() && !zone->watermap->InWater(m_Position.m_X, m_Position.m_Y, m_Position.m_Z)))
{
Map::Vertex dest(x_pos, y_pos, z_pos);
Map::Vertex dest(m_Position.m_X, m_Position.m_Y, m_Position.m_Z);
float newz = zone->zonemap->FindBestZ(dest, nullptr); + 2.0f;
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,m_Position.m_X,m_Position.m_Y,m_Position.m_Z);
if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check.
{
if(ABS(x - x_pos) < 0.5 && ABS(y - y_pos) < 0.5)
if(ABS(x - m_Position.m_X) < 0.5 && ABS(y - m_Position.m_Y) < 0.5)
{
if(ABS(z - z_pos) <= RuleR(Map, FixPathingZMaxDeltaMoving))
z_pos = z;
if(ABS(z - m_Position.m_Z) <= RuleR(Map, FixPathingZMaxDeltaMoving))
m_Position.m_Z = z;
else
z_pos = newz + 1;
m_Position.m_Z = newz + 1;
}
else
z_pos = newz+1;
m_Position.m_Z = newz+1;
}
}
}
@ -718,9 +718,9 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
SetMoving(true);
moved=true;
delta_x=x_pos-nx;
delta_y=y_pos-ny;
delta_z=z_pos-nz;
delta_x=m_Position.m_X-nx;
delta_y=m_Position.m_Y-ny;
delta_z=m_Position.m_Z-nz;
delta_heading=0;
if (IsClient())
@ -746,9 +746,9 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec
if(GetID()==0)
return true;
float nx = x_pos;
float ny = y_pos;
float nz = z_pos;
float nx = m_Position.m_X;
float ny = m_Position.m_Y;
float nz = m_Position.m_Z;
// if NPC is rooted
if (speed == 0.0) {
@ -780,30 +780,30 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec
// --------------------------------------------------------------------------
test_vector=sqrtf (x*x + y*y + z*z);
tar_vector = speed / sqrtf (tar_vx*tar_vx + tar_vy*tar_vy + tar_vz*tar_vz);
heading = CalculateHeadingToTarget(x, y);
m_Position.m_Heading = CalculateHeadingToTarget(x, y);
if (tar_vector >= 1.0) {
if(IsNPC()) {
entity_list.ProcessMove(CastToNPC(), x, y, z);
}
x_pos = x;
y_pos = y;
z_pos = z;
m_Position.m_X = x;
m_Position.m_Y = y;
m_Position.m_Z = z;
mlog(AI__WAYPOINTS, "Close enough, jumping to waypoint");
}
else {
float new_x = x_pos + tar_vx*tar_vector;
float new_y = y_pos + tar_vy*tar_vector;
float new_z = z_pos + tar_vz*tar_vector;
float new_x = m_Position.m_X + tar_vx*tar_vector;
float new_y = m_Position.m_Y + tar_vy*tar_vector;
float new_z = m_Position.m_Z + tar_vz*tar_vector;
if(IsNPC()) {
entity_list.ProcessMove(CastToNPC(), new_x, new_y, new_z);
}
x_pos = new_x;
y_pos = new_y;
z_pos = new_z;
mlog(AI__WAYPOINTS, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos);
m_Position.m_X = new_x;
m_Position.m_Y = new_y;
m_Position.m_Z = new_z;
mlog(AI__WAYPOINTS, "Next position (%.3f, %.3f, %.3f)", m_Position.m_X, m_Position.m_Y, m_Position.m_Z);
}
uint8 NPCFlyMode = 0;
@ -817,25 +817,25 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec
if(!NPCFlyMode && checkZ && zone->HasMap() && RuleB(Map, FixPathingZWhenMoving))
{
if(!RuleB(Watermap, CheckForWaterWhenMoving) || !zone->HasWaterMap() ||
(zone->HasWaterMap() && !zone->watermap->InWater(x_pos, y_pos, z_pos)))
(zone->HasWaterMap() && !zone->watermap->InWater(m_Position.m_X, m_Position.m_Y, m_Position.m_Z)))
{
Map::Vertex dest(x_pos, y_pos, z_pos);
Map::Vertex dest(m_Position.m_X, m_Position.m_Y, m_Position.m_Z);
float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f;
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,m_Position.m_X,m_Position.m_Y,m_Position.m_Z);
if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check.
{
if(ABS(x - x_pos) < 0.5 && ABS(y - y_pos) < 0.5)
if(ABS(x - m_Position.m_X) < 0.5 && ABS(y - m_Position.m_Y) < 0.5)
{
if(ABS(z - z_pos) <= RuleR(Map, FixPathingZMaxDeltaMoving))
z_pos = z;
if(ABS(z - m_Position.m_Z) <= RuleR(Map, FixPathingZMaxDeltaMoving))
m_Position.m_Z = z;
else
z_pos = newz + 1;
m_Position.m_Z = newz + 1;
}
else
z_pos = newz+1;
m_Position.m_Z = newz+1;
}
}
}
@ -845,9 +845,9 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec
tar_ndx=0;
this->SetMoving(true);
moved=true;
delta_x=(x_pos-nx);
delta_y=(y_pos-ny);
delta_z=(z_pos-nz);
delta_x=(m_Position.m_X-nx);
delta_y=(m_Position.m_Y-ny);
delta_z=(m_Position.m_Z-nz);
delta_heading=0;//(heading-nh)*8;
SendPosUpdate();
}
@ -948,9 +948,9 @@ void Mob::SendTo(float new_x, float new_y, float new_z) {
entity_list.ProcessMove(CastToNPC(), new_x, new_y, new_z);
}
x_pos = new_x;
y_pos = new_y;
z_pos = new_z;
m_Position.m_X = new_x;
m_Position.m_Y = new_y;
m_Position.m_Z = new_z;
mlog(AI__WAYPOINTS, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z);
if(flymode == FlyMode1)
@ -961,20 +961,20 @@ void Mob::SendTo(float new_x, float new_y, float new_z) {
if(zone->HasMap() && RuleB(Map, FixPathingZOnSendTo) )
{
if(!RuleB(Watermap, CheckForWaterOnSendTo) || !zone->HasWaterMap() ||
(zone->HasWaterMap() && !zone->watermap->InWater(x_pos, y_pos, z_pos)))
(zone->HasWaterMap() && !zone->watermap->InWater(m_Position.m_X, m_Position.m_Y, m_Position.m_Z)))
{
Map::Vertex dest(x_pos, y_pos, z_pos);
Map::Vertex dest(m_Position.m_X, m_Position.m_Y, m_Position.m_Z);
float newz = zone->zonemap->FindBestZ(dest, nullptr);
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,m_Position.m_X,m_Position.m_Y,m_Position.m_Z);
if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check.
z_pos = newz + 1;
m_Position.m_Z = newz + 1;
}
}
else
z_pos += 0.1;
m_Position.m_Z += 0.1;
}
void Mob::SendToFixZ(float new_x, float new_y, float new_z) {
@ -982,9 +982,9 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) {
entity_list.ProcessMove(CastToNPC(), new_x, new_y, new_z + 0.1);
}
x_pos = new_x;
y_pos = new_y;
z_pos = new_z + 0.1;
m_Position.m_X = new_x;
m_Position.m_Y = new_y;
m_Position.m_Z = new_z + 0.1;
//fix up pathing Z, this shouldent be needed IF our waypoints
//are corrected instead
@ -992,16 +992,16 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) {
if(zone->HasMap() && RuleB(Map, FixPathingZOnSendTo))
{
if(!RuleB(Watermap, CheckForWaterOnSendTo) || !zone->HasWaterMap() ||
(zone->HasWaterMap() && !zone->watermap->InWater(x_pos, y_pos, z_pos)))
(zone->HasWaterMap() && !zone->watermap->InWater(m_Position.m_X, m_Position.m_Y, m_Position.m_Z)))
{
Map::Vertex dest(x_pos, y_pos, z_pos);
Map::Vertex dest(m_Position.m_X, m_Position.m_Y, m_Position.m_Z);
float newz = zone->zonemap->FindBestZ(dest, nullptr);
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,m_Position.m_X,m_Position.m_Y,m_Position.m_Z);
if( (newz > -2000) && ABS(newz-dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check.
z_pos = newz + 1;
m_Position.m_Z = newz + 1;
}
}
}

View File

@ -347,10 +347,10 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc
//set the player's coordinates in the new zone so they have them
//when they zone into it
x_pos = dest_x; //these coordinates will now be saved when ~client is called
y_pos = dest_y;
z_pos = dest_z;
heading = dest_h; // Cripp: fix for zone heading
m_Position.m_X = dest_x; //these coordinates will now be saved when ~client is called
m_Position.m_Y = dest_y;
m_Position.m_Z = dest_z;
m_Position.m_Heading = dest_h; // Cripp: fix for zone heading
m_pp.heading = dest_h;
m_pp.zone_id = zone_id;
m_pp.zoneInstance = instance_id;
@ -500,9 +500,9 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
SetHeading(heading);
break;
case GMSummon:
zonesummon_x = x_pos = x;
zonesummon_y = y_pos = y;
zonesummon_z = z_pos = z;
zonesummon_x = m_Position.m_X = x;
zonesummon_y = m_Position.m_Y = y;
zonesummon_z = m_Position.m_Z = z;
SetHeading(heading);
zonesummon_id = zoneID;
@ -518,31 +518,31 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
zonesummon_ignorerestrictions = ignorerestrictions;
break;
case GateToBindPoint:
x = x_pos = m_pp.binds[0].x;
y = y_pos = m_pp.binds[0].y;
z = z_pos = m_pp.binds[0].z;
x = m_Position.m_X = m_pp.binds[0].x;
y = m_Position.m_Y = m_pp.binds[0].y;
z = m_Position.m_Z = m_pp.binds[0].z;
heading = m_pp.binds[0].heading;
break;
case ZoneToBindPoint:
x = x_pos = m_pp.binds[0].x;
y = y_pos = m_pp.binds[0].y;
z = z_pos = m_pp.binds[0].z;
x = m_Position.m_X = m_pp.binds[0].x;
y = m_Position.m_Y = m_pp.binds[0].y;
z = m_Position.m_Z = m_pp.binds[0].z;
heading = m_pp.binds[0].heading;
zonesummon_ignorerestrictions = 1;
LogFile->write(EQEMuLog::Debug, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading);
break;
case SummonPC:
zonesummon_x = x_pos = x;
zonesummon_y = y_pos = y;
zonesummon_z = z_pos = z;
zonesummon_x = m_Position.m_X = x;
zonesummon_y = m_Position.m_Y = y;
zonesummon_z = m_Position.m_Z = z;
SetHeading(heading);
break;
case Rewind:
LogFile->write(EQEMuLog::Debug, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName());
zonesummon_x = x_pos = x;
zonesummon_y = y_pos = y;
zonesummon_z = z_pos = z;
LogFile->write(EQEMuLog::Debug, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), m_Position.m_X, m_Position.m_Y, m_Position.m_Z, rewind_x, rewind_y, rewind_z, zone->GetShortName());
zonesummon_x = m_Position.m_X = x;
zonesummon_y = m_Position.m_Y = y;
zonesummon_z = m_Position.m_Z = z;
SetHeading(heading);
break;
default:
@ -652,10 +652,10 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
else {
if(zoneID == GetZoneID()) {
//properly handle proximities
entity_list.ProcessMove(this, x_pos, y_pos, z_pos);
proximity_x = x_pos;
proximity_y = y_pos;
proximity_z = z_pos;
entity_list.ProcessMove(this, m_Position.m_X, m_Position.m_Y, m_Position.m_Z);
proximity_x = m_Position.m_X;
proximity_y = m_Position.m_Y;
proximity_z = m_Position.m_Z;
//send out updates to people in zone.
SendPosition();
@ -723,9 +723,9 @@ void Client::SetBindPoint(int to_zone, int to_instance, float new_x, float new_y
if (to_zone == -1) {
m_pp.binds[0].zoneId = zone->GetZoneID();
m_pp.binds[0].instance_id = (zone->GetInstanceID() != 0 && zone->IsInstancePersistent()) ? zone->GetInstanceID() : 0;
m_pp.binds[0].x = x_pos;
m_pp.binds[0].y = y_pos;
m_pp.binds[0].z = z_pos;
m_pp.binds[0].x = m_Position.m_X;
m_pp.binds[0].y = m_Position.m_Y;
m_pp.binds[0].z = m_Position.m_Z;
}
else {
m_pp.binds[0].zoneId = to_zone;