From 8478607acea999f60c6ed2619354951da7b17f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvin=20Bergstr=C3=B6m?= <edvbe696@student.liu.se> Date: Thu, 7 Oct 2021 09:52:08 +0200 Subject: [PATCH] Fix the crash on linux --- src/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Unit.cpp b/src/Unit.cpp index 130eaa3..0927705 100644 --- a/src/Unit.cpp +++ b/src/Unit.cpp @@ -341,7 +341,7 @@ Unit Unit::getTarget() const CCUnitID t_id = getUnitPtr()->orders[0].target_unit_tag; // if it doesn't have a target. Return itself - if (m_bot->GetUnit(t_id) == nullptr) { + if (m_bot->GetUnit(t_id).isValid()) { return *this; } -- GitLab