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:
parent
22407709af
commit
9c032a3167
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user