mirror of
https://github.com/Wyrrrd/Gun_Turret_Alerts.git
synced 2026-06-04 00:06:38 +02:00
Adaptive threshold based on automated ammo count
-Threshold for alert comes is never higher than then number of ammo loaded by an inserter. -This fixes annoying alerts in Space Exploration's meteor defence, where the default ammo loaded is 4, and fixes the problem for any other mod.
This commit is contained in:
@@ -166,6 +166,11 @@ local function generate_alerts()
|
||||
if inventory and get_ammo_flag[mode] then
|
||||
if entity.type == "ammo-turret" then
|
||||
ammo_flag = get_ammo_flag[mode](inventory, player_threshold)
|
||||
if entity.prototype.automated_ammo_count then
|
||||
if entity.prototype.automated_ammo_count < player_threshold then
|
||||
ammo_flag = get_ammo_flag[mode](inventory, entity.prototype.automated_ammo_count)
|
||||
end
|
||||
end
|
||||
elseif entity.type == "car" then
|
||||
ammo_flag = get_ammo_flag[mode](inventory, player_threshold, entity.selected_gun_index)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user