mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-18 04:08:27 +00:00
[Quest API] Let HasQuestSub check encounters (#2435)
This fixes an edge case where trading would not detect the npc had a quest handler if it was registered inside a Lua encounter.
This commit is contained in:
@@ -1095,6 +1095,19 @@ bool LuaParser::HasFunction(std::string subname, std::string package_name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LuaParser::HasEncounterSub(const std::string& package_name, QuestEventID evt)
|
||||
{
|
||||
auto it = lua_encounter_events_registered.find(package_name);
|
||||
if (it != lua_encounter_events_registered.end()) {
|
||||
for (auto riter = it->second.begin(); riter != it->second.end(); ++riter) {
|
||||
if (riter->event_id == evt) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LuaParser::MapFunctions(lua_State *L) {
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user