feat: add fallback to pretend_list in plan_next_actions logic
Extend the decision flow in `plan_next_actions` to consider the `pretend_list` when no suitable target is found in `regard_list` within the 10‑unit time threshold. The new fallback selects a destination from `pretend_list` if its travel time is under 8 units, improving target selection robustness.
This commit is contained in:
@@ -222,6 +222,10 @@ def plan_next_actions(req):
|
||||
f,lentime = myMap.closest_in_range(p["posX"],p["posY"],regard_list)
|
||||
if f is not None and lentime<=10:
|
||||
dest = (f[0],f[1])
|
||||
else :
|
||||
f,lentime = myMap.closest_in_range(p["posX"],p["posY"],pretend_list)
|
||||
if f is not None and lentime<8:
|
||||
dest = (f[0],f[1])
|
||||
else:
|
||||
f,temp = myMap.closest_in_range(p["posX"],p["posY"],regard_list)
|
||||
if f is not None:
|
||||
|
||||
Reference in New Issue
Block a user