-- this is the laziest fucking code i have ever written it is shameful
local on_enemy_died_old = EnemyManager.on_enemy_died
function EnemyManager:on_enemy_died(dead_unit, damage_info)
    on_enemy_died_old(self, dead_unit, damage_info)
    if not managers.groupai:state():whisper_mode() then
        self:unqueue_task("EnemyManager._upd_corpse_disposal")
        -- added the math.random() since for some reason dead_unit.u_id is the same for all units killed with explosives and collaterals or graze ???
        DelayedCalls:Add( "removecorpse"..tostring(dead_unit.u_id)..tostring(math.random()), 2, function() -- edit this line to change the time it takes for a corpse to despawn
            dead_unit:set_slot(0)
        end )
    end
end