From: Christian Heller Date: Thu, 3 Mar 2016 01:19:15 +0000 (+0100) Subject: Server: Minor AI algorithm performance optimization. X-Git-Tag: tce~99 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Btodo.comment%7D%7D?a=commitdiff_plain;h=6a8352afec5e0b7b9adc315e1518569ff9a683d1;p=plomrogue Server: Minor AI algorithm performance optimization. --- diff --git a/server/ai.py b/server/ai.py index 71961a3..54bdb6f 100644 --- a/server/ai.py +++ b/server/ai.py @@ -59,12 +59,7 @@ def get_dir_to_target(t, filter): def animates_in_fov(maplength): return [Thing for Thing in world_db["Things"].values() if Thing["T_LIFEPOINTS"] and not Thing["carried"] - and not Thing == t and 118 == t["fovmap"][Thing["pos"]]] - - #def animates_in_fov_gen(maplength): - # return (Thing for Thing in world_db["Things"].values() - # if Thing["T_LIFEPOINTS"] and not Thing["carried"] - # and not Thing == t and 118 == t["fovmap"][Thing["pos"]]) + and 118 == t["fovmap"][Thing["pos"]] and not Thing == t] def good_attack_target(v): eat_cost = eat_vs_hunger_threshold(t["T_TYPE"])