1
0
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:
Aaron Veden 2022-04-23 19:33:33 -07:00
parent 1b752263c3
commit 422280da95
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 12 additions and 5 deletions

View File

@ -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:

View File

@ -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

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "1.1",
"version" : "3.0.1",
"version" : "3.0.2",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",