mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Make sure NPC's don't open keyed or lockpick enabled doors - also make sure we are opening doors and not platforms above or below
This commit is contained in:
parent
d504397593
commit
2c91d1db6e
@ -1058,16 +1058,29 @@ void Mob::AI_Process() {
|
|||||||
|
|
||||||
auto &door_list = entity_list.GetDoorsList();
|
auto &door_list = entity_list.GetDoorsList();
|
||||||
for (auto itr : door_list) {
|
for (auto itr : door_list) {
|
||||||
Doors* door = itr.second;
|
Doors *door = itr.second;
|
||||||
|
|
||||||
if (door->IsDoorOpen()) {
|
if (door->GetKeyItem())
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
float distance = DistanceSquared(this->m_Position, door->GetPosition());
|
if (door->GetLockpick())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (door->IsDoorOpen())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
float distance = DistanceSquared(this->m_Position, door->GetPosition());
|
||||||
float distance_scan_door_open = 20;
|
float distance_scan_door_open = 20;
|
||||||
|
|
||||||
if (distance <= (distance_scan_door_open * distance_scan_door_open)) {
|
if (distance <= (distance_scan_door_open * distance_scan_door_open)) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make sure we're opening a door within height relevance and not platforms
|
||||||
|
* above or below
|
||||||
|
*/
|
||||||
|
if (std::abs(this->m_Position.z - door->GetPosition().z) > 10)
|
||||||
|
continue;
|
||||||
|
|
||||||
door->ForceOpen(this);
|
door->ForceOpen(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user