From 9966b58fa48867ea5cac869607957279b91dfa17 Mon Sep 17 00:00:00 2001 From: hanakocz Date: Mon, 20 Jul 2020 19:41:05 +0200 Subject: [PATCH] rpg fix for getting xp, bonus hp -> bonus xp even if killed by turret --- modules/rpg_v2.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/rpg_v2.lua b/modules/rpg_v2.lua index 3d8b410d..26438e49 100644 --- a/modules/rpg_v2.lua +++ b/modules/rpg_v2.lua @@ -672,7 +672,7 @@ local function add_to_global_pool(amount, personal_tax) end rpg_extra.global_pool = rpg_extra.global_pool + fee - return fee + return amount - fee end local function global_pool(players, count) @@ -907,6 +907,13 @@ local function on_entity_died(event) if rpg_xp_yield[event.entity.name] then local amount = rpg_xp_yield[event.entity.name] amount = amount / 5 + if global.biter_health_boost then + local health_pool = global.biter_health_boost_units[event.entity.unit_number] + if health_pool then + amount = amount * (1 / health_pool[2]) + end + end + if rpg_extra.turret_kills_to_global_pool then add_to_global_pool(amount, false) end