Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions functions/pawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ end

function onPawnClassInitialized(BoardPawn, pawn)

-- Reference to overridden vanilla functions
-- Reference to overridden vanilla/modloader functions
BoardPawn.AddWeaponVanilla = pawn.AddWeapon
BoardPawn.GetArmedWeaponVanilla = BoardPawn.GetArmedWeapon
BoardPawn.GetEquippedWeaponsVanilla = BoardPawn.GetEquippedWeapons
BoardPawn.GetPoweredWeaponsVanilla = BoardPawn.GetPoweredWeapons
BoardPawn.GetQueuedVanilla = pawn.GetQueued
BoardPawn.IsJumperVanilla = pawn.IsJumper
BoardPawn.IsTeleporterVanilla = pawn.IsTeleporter
BoardPawn.IsWeaponEquippedVanilla = BoardPawn.IsWeaponEquipped
Expand All @@ -27,7 +28,7 @@ function onPawnClassInitialized(BoardPawn, pawn)
BoardPawn.SetFrozenVanilla = pawn.SetFrozen
BoardPawn.SetMechVanilla = pawn.SetMech
BoardPawn.SetShieldVanilla = pawn.SetShield


-- With the addition of BoardPawn.IsNeutral,
-- mod loader's BoardPawn.SetNeutral is no longer needed.
Expand Down Expand Up @@ -360,6 +361,25 @@ function onPawnClassInitialized(BoardPawn, pawn)

return self:GetPoweredWeaponsVanilla()
end

BoardPawn.GetQueued = function(self)
Assert.Equals("userdata", type(self), "Argument #0")

local memedit = memedit:get()
if memedit then
local target = self:GetQueuedTarget()
if target and Board:IsValid(target) then
return {
piOrigin = self:GetSpace(),
piTarget = target,
piQueuedShot = target,
iQueuedSkill = self:GetSelectedWeapon(),
}
end
return nil
end
self:GetQueuedVanilla()
end

BoardPawn.GetQueuedTarget = function(self)
Assert.Equals("userdata", type(self), "Argument #0")
Expand Down