[Tasks] Make Task Selector Cooldown Optional (#2420)

Some live npcs ignore the request cooldown timer (tutorialb)

A separate function had to be used for perl because the apis use an
array instead of array reference which won't allow a bool overload

This also replaces the fixed array and count args with a vector
This commit is contained in:
hg
2022-09-03 13:20:03 -04:00
committed by GitHub
parent 5e9a9e8afe
commit aa3c72c1de
10 changed files with 120 additions and 112 deletions
+6 -17
View File
@@ -1166,27 +1166,16 @@ public:
{
if (task_state) { task_state->UpdateTasksOnTouch(this, dz_switch_id); }
}
inline void TaskSetSelector(Mob *mob, int task_set_id)
inline void TaskSetSelector(Mob* mob, int task_set_id, bool ignore_cooldown)
{
if (task_manager) {
task_manager->TaskSetSelector(
this,
task_state,
mob,
task_set_id
);
if (task_manager && task_state) {
task_manager->TaskSetSelector(this, mob, task_set_id, ignore_cooldown);
}
}
inline void TaskQuestSetSelector(Mob *mob, int count, int *tasks)
inline void TaskQuestSetSelector(Mob* mob, const std::vector<int>& tasks, bool ignore_cooldown)
{
if (task_manager) {
task_manager->TaskQuestSetSelector(
this,
task_state,
mob,
count,
tasks
);
if (task_manager && task_state) {
task_manager->TaskQuestSetSelector(this, mob, tasks, ignore_cooldown);
}
}
inline void EnableTask(int task_count, int *task_list)