mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 02:11:30 +00:00
Merge branch 'master' into auras
This commit is contained in:
commit
6fcd39b4f8
30
zone/mob.cpp
30
zone/mob.cpp
@ -1437,10 +1437,8 @@ void Mob::SendHPUpdate(bool skip_self /*= false*/, bool force_update_all /*= fal
|
||||
}
|
||||
}
|
||||
|
||||
/* Used for NPCs mainly */
|
||||
void Mob::SendPosition()
|
||||
{
|
||||
|
||||
/* Used for mobs standing still - this does not send a delta */
|
||||
void Mob::SendPosition() {
|
||||
auto app = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)app->pBuffer;
|
||||
MakeSpawnUpdateNoDelta(spu);
|
||||
@ -1457,7 +1455,7 @@ void Mob::SendPosition()
|
||||
safe_delete(app);
|
||||
}
|
||||
|
||||
// this one is for mobs on the move, with deltas - this makes them walk
|
||||
/* Position updates for mobs on the move */
|
||||
void Mob::SendPositionUpdate(uint8 iSendToSelf) {
|
||||
auto app = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)app->pBuffer;
|
||||
@ -2729,25 +2727,25 @@ bool Mob::HateSummon() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Mob::FaceTarget(Mob* MobToFace) {
|
||||
Mob* facemob = MobToFace;
|
||||
if(!facemob) {
|
||||
void Mob::FaceTarget(Mob* mob_to_face /*= 0*/) {
|
||||
Mob* faced_mob = mob_to_face;
|
||||
if(!faced_mob) {
|
||||
if(!GetTarget()) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
facemob = GetTarget();
|
||||
faced_mob = GetTarget();
|
||||
}
|
||||
}
|
||||
|
||||
float oldheading = GetHeading();
|
||||
float newheading = CalculateHeadingToTarget(facemob->GetX(), facemob->GetY());
|
||||
if(oldheading != newheading) {
|
||||
SetHeading(newheading);
|
||||
if(moving)
|
||||
float current_heading = GetHeading();
|
||||
float new_heading = CalculateHeadingToTarget(faced_mob->GetX(), faced_mob->GetY());
|
||||
if(current_heading != new_heading) {
|
||||
SetHeading(new_heading);
|
||||
if (moving) {
|
||||
SendPositionUpdate();
|
||||
else
|
||||
{
|
||||
}
|
||||
else {
|
||||
SendPosition();
|
||||
}
|
||||
}
|
||||
|
||||
@ -576,7 +576,7 @@ public:
|
||||
void SetPrimaryAggro(bool value) { PrimaryAggro = value; if (value) AssistAggro = false; }
|
||||
void SetAssistAggro(bool value) { AssistAggro = value; if (PrimaryAggro) AssistAggro = false; }
|
||||
bool HateSummon();
|
||||
void FaceTarget(Mob* MobToFace = 0);
|
||||
void FaceTarget(Mob* mob_to_face = 0);
|
||||
void SetHeading(float iHeading) { if(m_Position.w != iHeading) { pLastChange = Timer::GetCurrentTime();
|
||||
m_Position.w = iHeading; } }
|
||||
void WipeHateList();
|
||||
|
||||
@ -134,17 +134,15 @@ void NPC::PauseWandering(int pausetime)
|
||||
{ // causes wandering to stop but is resumable
|
||||
// 0 pausetime means pause until resumed
|
||||
// otherwise automatically resume when time is up
|
||||
if (GetGrid() != 0)
|
||||
{
|
||||
if (GetGrid() != 0) {
|
||||
moving = false;
|
||||
DistractedFromGrid = true;
|
||||
Log(Logs::Detail, Logs::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime);
|
||||
SendPosition();
|
||||
if (pausetime<1)
|
||||
{ // negative grid number stops him dead in his tracks until ResumeWandering()
|
||||
if (pausetime < 1) { // negative grid number stops him dead in his tracks until ResumeWandering()
|
||||
SetGrid(0 - GetGrid());
|
||||
}
|
||||
else
|
||||
{ // specified waiting time, he'll resume after that
|
||||
else { // specified waiting time, he'll resume after that
|
||||
AI_walking_timer->Start(pausetime * 1000); // set the timer
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user