mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-27 02:29:43 +00:00
Added facing check to auto attack LoS code
The Mob::InFrontMob check uses 56 degrees which is where the client will generate the "You cannon see your target." message. There were still a few weird angles that I was able to still attack, but in like 99% of the cases it should work ...
This commit is contained in:
@@ -1303,6 +1303,7 @@ void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app)
|
||||
aa_los_me.x = 0;
|
||||
aa_los_me.y = 0;
|
||||
aa_los_me.z = 0;
|
||||
aa_los_me_heading = 0;
|
||||
aa_los_them.x = 0;
|
||||
aa_los_them.y = 0;
|
||||
aa_los_them.z = 0;
|
||||
@@ -1322,24 +1323,25 @@ void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app)
|
||||
aa_los_me.x = GetX();
|
||||
aa_los_me.y = GetY();
|
||||
aa_los_me.z = GetZ();
|
||||
aa_los_me_heading = GetHeading();
|
||||
aa_los_them.x = aa_los_them_mob->GetX();
|
||||
aa_los_them.y = aa_los_them_mob->GetY();
|
||||
aa_los_them.z = aa_los_them_mob->GetZ();
|
||||
if(CheckLosFN(aa_los_them_mob))
|
||||
los_status = true;
|
||||
else
|
||||
los_status = false;
|
||||
los_status = CheckLosFN(aa_los_them_mob);
|
||||
los_status_facing = aa_los_them_mob->InFrontMob(this, aa_los_them.x, aa_los_them.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
aa_los_me.x = GetX();
|
||||
aa_los_me.y = GetY();
|
||||
aa_los_me.z = GetZ();
|
||||
aa_los_me_heading = GetHeading();
|
||||
aa_los_them.x = 0;
|
||||
aa_los_them.y = 0;
|
||||
aa_los_them.z = 0;
|
||||
aa_los_them_mob = nullptr;
|
||||
los_status = false;
|
||||
los_status_facing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user