mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 23:58:25 +00:00
Merge pull request #1048 from KinglyKrab/master
Add GetNPCBySpawnID() to Perl/Lua.
This commit is contained in:
@@ -1116,6 +1116,22 @@ NPC *EntityList::GetNPCByNPCTypeID(uint32 npc_id)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NPC *EntityList::GetNPCBySpawnID(uint32 spawn_id)
|
||||
{
|
||||
if (spawn_id == 0 || npc_list.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto it = npc_list.begin();
|
||||
while (it != npc_list.end()) {
|
||||
if (it->second->GetSpawnGroupId() == spawn_id) {
|
||||
return it->second;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Mob *EntityList::GetMob(uint16 get_id)
|
||||
{
|
||||
Entity *ent = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user