AbstractScript uses NPC templates to register events.

This commit is contained in:
MobiusDevelopment
2021-09-17 14:03:38 +00:00
parent 6b6e2585c8
commit 3918bbc997
42 changed files with 151 additions and 46 deletions

View File

@@ -1495,6 +1495,12 @@ public class Npc extends Creature
return vars != null ? vars : addScript(new NpcVariables());
}
@Override
public boolean hasListener(EventType type)
{
return getTemplate().hasListener(type);
}
/**
* Send an "event" to all NPCs within given radius
* @param eventName - name of event

View File

@@ -108,8 +108,7 @@ public class ListenersContainer
public boolean hasListener(EventType type)
{
// FIXME: return (_listeners != null) && !getListeners(type).isEmpty();
return !getListeners(type).isEmpty();
return (_listeners != null) && !getListeners(type).isEmpty();
}
/**