From f8b75f6211966dc455244d051e354168522cfa48 Mon Sep 17 00:00:00 2001 From: Aingar <47479741+Aingar@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:06:43 +0200 Subject: [PATCH] Added Hk::Solar::ExistsAndAlive() wrapper method --- include/API/FLServer/Solar.hpp | 1 + source/API/FLServer/Solar.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/API/FLServer/Solar.hpp b/include/API/FLServer/Solar.hpp index c9f619204..667bf8837 100644 --- a/include/API/FLServer/Solar.hpp +++ b/include/API/FLServer/Solar.hpp @@ -10,4 +10,5 @@ namespace Hk::Solar DLL Action GetBaseByWildcard(std::wstring_view targetBaseName); DLL Action GetAffiliation(BaseId solarId); DLL Action GetCommodityPrice(BaseId baseId, GoodId goodId); + DLL Action ExistsAndAlive(uint id); } // namespace Hk::Solar diff --git a/source/API/FLServer/Solar.cpp b/source/API/FLServer/Solar.cpp index f56d0f658..5e28c00dd 100644 --- a/source/API/FLServer/Solar.cpp +++ b/source/API/FLServer/Solar.cpp @@ -151,4 +151,17 @@ namespace Hk::Solar } return { price }; } + + Action ExistsAndAlive(uint id) + { + int isAlive = pub::SpaceObj::ExistsAndAlive(id); + if (isAlive == 0) + { + return { true }; + } + else + { + return { false }; + } + } } // namespace Hk::Solar