mirror of
https://github.com/Wyrrrd/Gun_Turret_Alerts.git
synced 2026-06-03 15:56: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:
@@ -1,4 +1,9 @@
|
|||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 1.1.7
|
||||||
|
Date: 2021-06-21
|
||||||
|
Compatibility:
|
||||||
|
- Added compatibility to Space Exploration's Meteor defence and other mods (no longer displays alert when ammo is dynamically loaded) (by snouz)
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 1.1.6
|
Version: 1.1.6
|
||||||
Date: 2021-04-22
|
Date: 2021-04-22
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|||||||
@@ -166,6 +166,11 @@ local function generate_alerts()
|
|||||||
if inventory and get_ammo_flag[mode] then
|
if inventory and get_ammo_flag[mode] then
|
||||||
if entity.type == "ammo-turret" then
|
if entity.type == "ammo-turret" then
|
||||||
ammo_flag = get_ammo_flag[mode](inventory, player_threshold)
|
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
|
elseif entity.type == "car" then
|
||||||
ammo_flag = get_ammo_flag[mode](inventory, player_threshold, entity.selected_gun_index)
|
ammo_flag = get_ammo_flag[mode](inventory, player_threshold, entity.selected_gun_index)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user