From d846902a56d027d18f59143946368f5b4665a79d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Bergstr=C3=B6m?= <david.bergstrom@liu.se> Date: Tue, 24 Nov 2020 16:38:42 +0100 Subject: [PATCH] Fix bug where distance is not defined --- extra.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extra.py b/extra.py index 2dd568c..19db1be 100644 --- a/extra.py +++ b/extra.py @@ -1,6 +1,8 @@ from library import IDABot, Unit, UnitType, TypeData, Point2DI, PLAYER_SELF from typing import Optional +Point2D.distance = lambda self, other: sqrt((self.x - other.x)**2 + (self.y - other.y)**2) + def has_addon(bot: IDABot, candidate: Unit, addon_type: UnitType): """ -- GitLab