Skip to content

Commit

Permalink
VERSION{v1.93}
Browse files Browse the repository at this point in the history
updated to v1.93
  • Loading branch information
springraaar committed Sep 8, 2022
1 parent 0bfd6ef commit b2cb045
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Binary file modified bitmaps/loadpictures/loadscreen1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions changelog.nfo
@@ -1,3 +1,8 @@
2022/09/08 ------------------ NOTES v1.93 ----------------------

- fixed an issue with triggering the disable animation for buildings that are disabled due to low energy
- changed the disable energy threshold for level 1 metal extractors from 1300 to 50 energy

2022/09/06 ------------------ NOTES v1.92 ----------------------

- fixed an issue which prevented AVEN "Valiant", GEAR "Strainer" and CLAW "Phalanx" ships from reaching full speed
Expand Down
21 changes: 14 additions & 7 deletions luarules/gadgets/unit_estall_disable.lua
Expand Up @@ -49,7 +49,8 @@ local disabledUnits = {}
local changeStateDelay = 3 -- delay in seconds before state of unit can be changed. Do not set it below 2 seconds, because it takes 2 seconds before enabled unit reaches full energy use
local JAMMER_ENERGY_DISABLE_THRESHOLD = 300
local RADAR_ENERGY_DISABLE_THRESHOLD = 900
local EXTRACTOR_ENERGY_DISABLE_THRESHOLD = 1300
local ADV_EXTRACTOR_ENERGY_DISABLE_THRESHOLD = 1300
local EXTRACTOR_ENERGY_DISABLE_THRESHOLD = 50

local radarDefs = {
[ UnitDefNames['aven_advanced_radar_tower'].id ] = true,
Expand Down Expand Up @@ -111,11 +112,7 @@ local jammerDefs = {
[ UnitDefNames['sphere_mist'].id ] = true
}

local metalDefs = {
[ UnitDefNames['aven_metal_extractor'].id ] = true,
[ UnitDefNames['gear_metal_extractor'].id ] = true,
[ UnitDefNames['claw_metal_extractor'].id ] = true,
[ UnitDefNames['sphere_metal_extractor'].id ] = true,
local advMetalDefs = {
[ UnitDefNames['aven_exploiter'].id ] = true,
[ UnitDefNames['gear_exploiter'].id ] = true,
[ UnitDefNames['claw_exploiter'].id ] = true,
Expand All @@ -126,6 +123,13 @@ local metalDefs = {
[ UnitDefNames['sphere_moho_mine'].id ] = true
}

local metalDefs = {
[ UnitDefNames['aven_metal_extractor'].id ] = true,
[ UnitDefNames['gear_metal_extractor'].id ] = true,
[ UnitDefNames['claw_metal_extractor'].id ] = true,
[ UnitDefNames['sphere_metal_extractor'].id ] = true
}

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Expand All @@ -141,9 +145,12 @@ function AddUnit(unitID, unitDefID)
units[unitID] = { defID = unitDefID, changeStateTime = spGetGameSeconds(), threshold = JAMMER_ENERGY_DISABLE_THRESHOLD }
elseif ( radarDefs[unitDefID]) then
units[unitID] = { defID = unitDefID, changeStateTime = spGetGameSeconds(), threshold = RADAR_ENERGY_DISABLE_THRESHOLD}
elseif ( advMetalDefs[unitDefID]) then
units[unitID] = { defID = unitDefID, changeStateTime = spGetGameSeconds(), threshold = ADV_EXTRACTOR_ENERGY_DISABLE_THRESHOLD}
elseif ( metalDefs[unitDefID]) then
units[unitID] = { defID = unitDefID, changeStateTime = spGetGameSeconds(), threshold = EXTRACTOR_ENERGY_DISABLE_THRESHOLD}
end

end

function RemoveUnit(unitID)
Expand Down Expand Up @@ -210,7 +217,7 @@ function gadget:GameFrame(n)

-- disable units that aren't fully built or if they're set to "off"
local _,_,_,_,bp = spGetUnitHealth(unitID)
if (bp and bp < 1) or (not unitStates.active) then
if (bp and bp < 1) or (not unitStates.active) or (disabledUnits[unitID]) then
spCallCOBScript(unitID, "Deactivate", 0)
--Spring.Echo("deactivating... "..unitID)
else
Expand Down

0 comments on commit b2cb045

Please sign in to comment.