1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

fixed builder unit not being correctly accounted for in onBuilderArrived

This commit is contained in:
Aaron Veden 2021-12-17 17:12:08 -08:00
parent 22407709af
commit 9c032a3167
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 8 additions and 2 deletions

View File

@ -3,6 +3,8 @@ Version: 2.0.4
Date: 17. 12. 2021
Improvements:
- Added RTStasisRealm to surface exclusion list
Bugfixes:
- Fixed onBuilderArrived if the builder was a unit and not a group (Thanks DBotThePony for reporting)
---------------------------------------------------------------------------------------------------
Version: 2.0.3

View File

@ -867,11 +867,13 @@ end
local function onBuilderArrived(event)
local builder = event.group
local usingUnit = false
if not (builder and builder.valid) then
builder = event.unit
if not (builder and builder.valid and builder.force.name == "enemy") then
return
end
usingUnit = true
elseif (builder.force.name ~= "enemy") then
return
end
@ -881,8 +883,10 @@ local function onBuilderArrived(event)
return
end
map.activeSurface = true
local squad = universe.groupNumberToSquad[builder.group_number]
squad.commandTick = event.tick + COMMAND_TIMEOUT * 10
if not usingUnit then
local squad = universe.groupNumberToSquad[builder.group_number]
squad.commandTick = event.tick + COMMAND_TIMEOUT * 10
end
if universe.aiPointsPrintSpendingToChat then
game.print("Settled: [gps=" .. builder.position.x .. "," .. builder.position.y .."]")
end