mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11923] simplify HandleMmapTestArea code a bit
This commit is contained in:
parent
49bd484a41
commit
02b89c794c
2 changed files with 2 additions and 9 deletions
|
|
@ -7123,18 +7123,11 @@ bool ChatHandler::HandleMmapTestArea(char* args)
|
||||||
float radius = 40.0f;
|
float radius = 40.0f;
|
||||||
ExtractFloat(&args, radius);
|
ExtractFloat(&args, radius);
|
||||||
|
|
||||||
CellPair pair(MaNGOS::ComputeCellPair( m_session->GetPlayer()->GetPositionX(), m_session->GetPlayer()->GetPositionY()) );
|
|
||||||
Cell cell(pair);
|
|
||||||
cell.SetNoCreate();
|
|
||||||
|
|
||||||
std::list<Creature*> creatureList;
|
std::list<Creature*> creatureList;
|
||||||
|
|
||||||
MaNGOS::AnyUnitInObjectRangeCheck go_check(m_session->GetPlayer(), radius);
|
MaNGOS::AnyUnitInObjectRangeCheck go_check(m_session->GetPlayer(), radius);
|
||||||
MaNGOS::CreatureListSearcher<MaNGOS::AnyUnitInObjectRangeCheck> go_search(creatureList, go_check);
|
MaNGOS::CreatureListSearcher<MaNGOS::AnyUnitInObjectRangeCheck> go_search(creatureList, go_check);
|
||||||
TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::AnyUnitInObjectRangeCheck>, GridTypeMapContainer> go_visit(go_search);
|
|
||||||
|
|
||||||
// Get Creatures
|
// Get Creatures
|
||||||
cell.Visit(pair, go_visit, *(m_session->GetPlayer()->GetMap()), *(m_session->GetPlayer()), radius);
|
Cell::VisitGridObjects(m_session->GetPlayer(), go_search, radius);
|
||||||
|
|
||||||
if (!creatureList.empty())
|
if (!creatureList.empty())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11922"
|
#define REVISION_NR "11923"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue