From 9e2820ba83c2cce5ee5ecb44e5a12b51cd1c8875 Mon Sep 17 00:00:00 2001 From: IQuant Date: Sun, 10 Nov 2024 18:58:42 +0300 Subject: [PATCH] Also fix the game over message --- .../files/system/local_health/local_health.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/quant.ew/files/system/local_health/local_health.lua b/quant.ew/files/system/local_health/local_health.lua index 952a9c79..0fb7b679 100644 --- a/quant.ew/files/system/local_health/local_health.lua +++ b/quant.ew/files/system/local_health/local_health.lua @@ -273,16 +273,25 @@ end local function do_game_over(message) net.proxy_notify_game_over() ctx.run_ended = true - local damage_model = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "DamageModelComponent") GameRemoveFlagRun("ew_flag_notplayer_active") set_camera_free(true, ctx.my_player.entity) - if damage_model ~= nil and #(EntityGetAllChildren(ctx.my_player.entity) or {}) ~= 0 then + + if #(EntityGetAllChildren(ctx.my_player.entity) or {}) ~= 0 then local ent = end_poly_effect(ctx.my_player.entity) if ent ~= nil then polymorph.switch_entity(ent) if ctx.my_player.entity ~= nil then - ComponentSetValue2(damage_model, "wait_for_kill_flag_on_death", false) - EntityInflictDamage(ctx.my_player.entity, 1000000, "DAMAGE_CURSE", message, "NONE", 0, 0, GameGetWorldStateEntity()) + local stat_component = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "GameStatsComponent") + if stat_component ~= nil then + ComponentSetValue2(stat_component, "extra_death_msg", "") + print("extra_death_msg removed") + end + + local damage_model = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "DamageModelComponent") + if damage_model ~= nil then + ComponentSetValue2(damage_model, "wait_for_kill_flag_on_death", false) + EntityInflictDamage(ctx.my_player.entity, 1000000, "DAMAGE_CURSE", message, "NONE", 0, 0, GameGetWorldStateEntity()) + end end end end