Skip to content

Commit

Permalink
Annotate and clean up warnings in TPodTowerUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 committed Jan 12, 2025
1 parent 71c146e commit e3e5140
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lua/ScenarioFramework.lua
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ end

---
---@param unit Unit
---@param army number
---@param triggerOnGiven boolean
---@param army Army
---@param triggerOnGiven? boolean
---@return Unit
function GiveUnitToArmy(unit, army, triggerOnGiven)
-- Shared army mod will result in different players having the same army number
Expand Down
17 changes: 13 additions & 4 deletions lua/sim/units/uef/TPodTowerUnit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@

local TStructureUnit = import('/lua/terranunits.lua').TStructureUnit

---@class PodDataEntry
---@field PodHandle XEA3204
---@field PodUnitID "XEA3204" # Determined in pod tower's blueprint's `Economy.EngineeringPods`
---@field PodName string # Determined in pod tower's blueprint's `Economy.EngineeringPods`
---@field Active boolean
---@field PodAttachpoint Bone # Determined in pod tower's blueprint's `Economy.EngineeringPods`
---@field CreateWithUnit boolean # Determined in pod tower's blueprint's `Economy.EngineeringPods`

---@class TPodTowerUnit : TStructureUnit
---@field PodData table<string, PodDataEntry>
---@field OpenAnim moho.AnimationManipulator
TPodTowerUnit = ClassUnit(TStructureUnit) {

---@param self TPodTowerUnit
Expand Down Expand Up @@ -134,8 +144,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) {
---@return Unit
CreatePod = function(self, podName)
local location = self:GetPosition(self.PodData[podName].PodAttachpoint)
self.PodData[podName].PodHandle = CreateUnitHPR(self.PodData[podName].PodUnitID, self.Army, location[1],
location[2], location[3], 0, 0, 0)
self.PodData[podName].PodHandle = CreateUnitHPR(self.PodData[podName].PodUnitID, self.Army, location[1], location[2], location[3], 0, 0, 0)--[[@as XEA3204]]
self.PodData[podName].PodHandle:SetParent(self, podName)
self.PodData[podName].Active = true
return self.PodData[podName].PodHandle
Expand Down Expand Up @@ -356,8 +365,8 @@ TPodTowerUnit = ClassUnit(TStructureUnit) {
self.MaintainState = true
end,

OnStopBuild = function(self, unitBuilding)
TStructureUnit.OnStopBuild(self, unitBuilding)
OnStopBuild = function(self, unitBuilding, order)
TStructureUnit.OnStopBuild(self, unitBuilding, order)
self:EnableDefaultToggleCaps()
if unitBuilding:GetFractionComplete() == 1 then
NotifyUpgrade(self, unitBuilding)
Expand Down

0 comments on commit e3e5140

Please sign in to comment.