mirror of
https://github.com/Anime-Game-Servers/Grasscutter-Quests.git
synced 2024-11-27 06:20:37 +00:00
Have timers trigger by events with source = "". Remove redundant checking code.
This commit is contained in:
parent
7d763ba0ba
commit
d74a7c0228
@ -993,19 +993,12 @@ public class SceneScriptManager {
|
||||
}
|
||||
logger.info("creating group timer event for group {} with source {} and time {}",
|
||||
groupID, source, time);
|
||||
for(SceneTrigger trigger : group.getTriggers().values()){
|
||||
if(trigger.getEvent() == EVENT_TIMER_EVENT &&trigger.getSource().equals(source)){
|
||||
logger.warn("[LUA] Found timer trigger with source {} for group {} : {}",
|
||||
source, groupID, trigger.getName());
|
||||
cancelGroupTimerEvent(groupID, source);
|
||||
var taskIdentifier = Grasscutter.getGameServer().getScheduler().scheduleDelayedRepeatingTask(() ->
|
||||
callEvent(new ScriptArgs(groupID, EVENT_TIMER_EVENT)
|
||||
.setEventSource(source)), (int)time, (int)time);
|
||||
var groupTasks = activeGroupTimers.computeIfAbsent(groupID, k -> new HashSet<>());
|
||||
groupTasks.add(new Pair<>(source, taskIdentifier));
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public int cancelGroupTimerEvent(int groupID, String source) {
|
||||
|
Loading…
Reference in New Issue
Block a user