mirror of
https://github.com/minetest-mods/technic.git
synced 2025-02-22 23:00:22 +01:00
add technic.radiation_callback(object, damage)
preparation for https://github.com/pandorabox-io/hazmat_suit/issues/1
This commit is contained in:
parent
2a4a54afc8
commit
8f9486cc37
@ -248,6 +248,12 @@ local cache_scaled_shielding = {}
|
||||
local rad_dmg_cutoff = 0.2
|
||||
local radiated_players = {}
|
||||
|
||||
-- radiation callback function for external use
|
||||
-- (radiation counters, etc)
|
||||
-- parameters: object / damage (before armor calculations)
|
||||
function technic.radiation_callback(object, damage)
|
||||
end
|
||||
|
||||
local armor_enabled = technic.config:get_bool("enable_radiation_protection")
|
||||
local entity_damage = technic.config:get_bool("enable_entity_radiation_damage")
|
||||
local longterm_damage = technic.config:get_bool("enable_longterm_radiation_damage")
|
||||
@ -324,6 +330,10 @@ local function dmg_object(pos, object, strength)
|
||||
if not dmg then
|
||||
return
|
||||
end
|
||||
|
||||
-- execute radiation callback
|
||||
technic.radiation_callback(object, dmg)
|
||||
|
||||
if armor_enabled then
|
||||
dmg = dmg * mul
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user