mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 15:00:25 +00:00
Removed existing movement code, started replacing
This commit is contained in:
+40
-40
@@ -242,46 +242,46 @@ bool Client::Process() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Build a close range list of NPC's */
|
||||
if (npc_close_scan_timer.Check()) {
|
||||
close_mobs.clear();
|
||||
|
||||
/* Force spawn updates when traveled far */
|
||||
bool force_spawn_updates = false;
|
||||
float client_update_range = (RuleI(Range, ClientForceSpawnUpdateRange) * RuleI(Range, ClientForceSpawnUpdateRange));
|
||||
if (DistanceSquared(last_major_update_position, m_Position) >= client_update_range) {
|
||||
last_major_update_position = m_Position;
|
||||
force_spawn_updates = true;
|
||||
}
|
||||
|
||||
float scan_range = (RuleI(Range, ClientNPCScan) * RuleI(Range, ClientNPCScan));
|
||||
auto &mob_list = entity_list.GetMobList();
|
||||
for (auto itr = mob_list.begin(); itr != mob_list.end(); ++itr) {
|
||||
Mob* mob = itr->second;
|
||||
|
||||
float distance = DistanceSquared(m_Position, mob->GetPosition());
|
||||
if (mob->IsNPC()) {
|
||||
if (distance <= scan_range) {
|
||||
close_mobs.insert(std::pair<Mob *, float>(mob, distance));
|
||||
}
|
||||
else if ((mob->GetAggroRange() * mob->GetAggroRange()) > scan_range) {
|
||||
close_mobs.insert(std::pair<Mob *, float>(mob, distance));
|
||||
}
|
||||
}
|
||||
|
||||
if (force_spawn_updates && mob != this) {
|
||||
|
||||
if (mob->is_distance_roamer) {
|
||||
mob->SendPositionUpdateToClient(this);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (distance <= client_update_range)
|
||||
mob->SendPositionUpdateToClient(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
///* Build a close range list of NPC's */
|
||||
//if (npc_close_scan_timer.Check()) {
|
||||
// close_mobs.clear();
|
||||
//
|
||||
// /* Force spawn updates when traveled far */
|
||||
// bool force_spawn_updates = false;
|
||||
// float client_update_range = (RuleI(Range, ClientForceSpawnUpdateRange) * RuleI(Range, ClientForceSpawnUpdateRange));
|
||||
// if (DistanceSquared(last_major_update_position, m_Position) >= client_update_range) {
|
||||
// last_major_update_position = m_Position;
|
||||
// force_spawn_updates = true;
|
||||
// }
|
||||
//
|
||||
// float scan_range = (RuleI(Range, ClientNPCScan) * RuleI(Range, ClientNPCScan));
|
||||
// auto &mob_list = entity_list.GetMobList();
|
||||
// for (auto itr = mob_list.begin(); itr != mob_list.end(); ++itr) {
|
||||
// Mob* mob = itr->second;
|
||||
//
|
||||
// float distance = DistanceSquared(m_Position, mob->GetPosition());
|
||||
// if (mob->IsNPC()) {
|
||||
// if (distance <= scan_range) {
|
||||
// close_mobs.insert(std::pair<Mob *, float>(mob, distance));
|
||||
// }
|
||||
// else if ((mob->GetAggroRange() * mob->GetAggroRange()) > scan_range) {
|
||||
// close_mobs.insert(std::pair<Mob *, float>(mob, distance));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (force_spawn_updates && mob != this) {
|
||||
//
|
||||
// if (mob->is_distance_roamer) {
|
||||
// mob->SendPositionUpdateToClient(this);
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (distance <= client_update_range)
|
||||
// mob->SendPositionUpdateToClient(this);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//}
|
||||
|
||||
bool may_use_attacks = false;
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user