home · contact · privacy
Server, plugin: Refactor ai (plugin hooks).
[plomrogue] / server / ai.py
index a243aa4dfc9e49d20c096162089185576fd21e7f..0d1effce2262a6f0473d270e4a37ad3128cc19de 100644 (file)
@@ -285,12 +285,13 @@ def ai(t):
         if get_dir_to_target(t, "f"):
             return
         sel = get_inventory_slot_to_consume(t)
+        from server.config.ai import ai_hook_pickup_test
         if -1 != sel:
             t["T_COMMAND"] = [id for id in world_db["ThingActions"]
                               if world_db["ThingActions"][id]["TA_NAME"]
                                  == "use"][0]
             t["T_ARGUMENT"] = sel
-        elif standing_on_food(t):
+        elif standing_on_food(t) and ai_hook_pickup_test(t):
                 t["T_COMMAND"] = [id for id in world_db["ThingActions"]
                                   if world_db["ThingActions"][id]["TA_NAME"]
                                   == "pickup"][0]