From e7e78387b00641357b33a5642cc86d17f1c444b1 Mon Sep 17 00:00:00 2001 From: Andy <86536434+Andyyy7666@users.noreply.github.com> Date: Sat, 30 Dec 2023 10:35:57 +0100 Subject: [PATCH] fix(bridge/nd): add boss check (#1578) --- modules/bridge/nd/server.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/bridge/nd/server.lua b/modules/bridge/nd/server.lua index 8c6ac758fc..ddbf8a871a 100644 --- a/modules/bridge/nd/server.lua +++ b/modules/bridge/nd/server.lua @@ -98,6 +98,15 @@ function server.buyLicense(inv, license) return true, "have_purchased" end +---@diagnostic disable-next-line: duplicate-set-field +function server.isPlayerBoss(playerId, group) + local player = NDCore.getPlayer(playerId) + if not player then return end + + local groupInfo = player.getGroup(group) + return groupInfo and groupInfo.isBoss +end + ---@param entityId number ---@return number | string ---@diagnostic disable-next-line: duplicate-set-field