mirror of
https://github.com/veden/Rampant.git
synced 2025-03-17 20:58:35 +02:00
FACTO-117: Fixed on_rocket_launched base may be nil
This commit is contained in:
parent
1b752263c3
commit
422280da95
@ -1,3 +1,8 @@
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 3.0.2
|
||||
Bugfixes:
|
||||
- Fixed on_rocket_launched enemy base not be close enough for point gain
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 3.0.1
|
||||
Contributions:
|
||||
|
10
control.lua
10
control.lua
@ -649,10 +649,12 @@ local function onRocketLaunch(event)
|
||||
local chunk = getChunkByPosition(map, entity.position)
|
||||
if (chunk ~= -1) then
|
||||
local base = findNearbyBase(map, chunk)
|
||||
base.rocketLaunched = base.rocketLaunched + 1
|
||||
base.unitPoints = base.unitPoints + 5000
|
||||
if universe.aiPointsPrintGainsToChat then
|
||||
game.print(map.surface.name .. ": Points: +" .. 5000 .. ". [Rocket Launch] Total: " .. string.format("%.2f", base.unitPoints))
|
||||
if base then
|
||||
base.rocketLaunched = base.rocketLaunched + 1
|
||||
base.unitPoints = base.unitPoints + 5000
|
||||
if universe.aiPointsPrintGainsToChat then
|
||||
game.print(map.surface.name .. ": Points: +" .. 5000 .. ". [Rocket Launch] Total: " .. string.format("%.2f", base.unitPoints))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user