diff --git a/server/bin/exported/hero/standard.xml b/server/bin/exported/hero/standard.xml
index 3d6e6220..91bb39b7 100644
--- a/server/bin/exported/hero/standard.xml
+++ b/server/bin/exported/hero/standard.xml
@@ -48,7 +48,7 @@
-
+
diff --git a/server/bin/exported/task/MobaMode.xml b/server/bin/exported/task/MobaMode.xml
index 85bb6743..911fb1c0 100644
--- a/server/bin/exported/task/MobaMode.xml
+++ b/server/bin/exported/task/MobaMode.xml
@@ -5,12 +5,13 @@
+
-
+
@@ -34,7 +35,7 @@
-
+
@@ -64,7 +65,7 @@
-
+
diff --git a/server/gameserver/base_agent.cc b/server/gameserver/base_agent.cc
index 9719a672..d9231482 100644
--- a/server/gameserver/base_agent.cc
+++ b/server/gameserver/base_agent.cc
@@ -77,10 +77,12 @@ bool BaseAgent::PreEnterCoroutine(int co_id, behaviac::EBTStatus& status)
}
auto& co = itr->second;
if (co->status != behaviac::BT_RUNNING) {
-#ifdef DEBUG
abort();
-#endif
- return true;
+ }
+ if (co->IsAbort()) {
+ list_del_init(&co->entry);
+ coroutines_hash_.erase(itr);
+ return false;
}
co->status = co->runing_cb(co.get());
status = co->status;
@@ -94,6 +96,7 @@ bool BaseAgent::PreEnterCoroutine(int co_id, behaviac::EBTStatus& status)
void BaseAgent::CheckCoroutineEvent()
{
int co_id = -1;
+ bool has_abort_co = false;
{
list_head* pos = nullptr;
list_head* next = nullptr;
@@ -188,6 +191,9 @@ void BaseAgent::AbortCoroutine(int co_id)
if (!itr->second->IsAbort()) {
itr->second->Abort(GetRoom()->GetFrameNo());
itr->second->runing_cb(itr->second.get());
+ itr->second->runing_cb = nullptr;
+ list_del_init(&itr->second->entry);
+ coroutines_hash_.erase(itr);
}
}
}
diff --git a/server/gameserver/btcoroutine.h b/server/gameserver/btcoroutine.h
index 1e2d2cbf..a3292548 100644
--- a/server/gameserver/btcoroutine.h
+++ b/server/gameserver/btcoroutine.h
@@ -13,6 +13,7 @@ class BtCoroutine
long long sleep_end_frameno = 0;
int sleep_time = 0;
list_head entry;
+ long long abort_exec_times = 0;
long long abort_frameno = 0;
behaviac::EBTStatus status = behaviac::BT_RUNNING;