Skip to content

Commit

Permalink
Remove Pawn.IsPowered, that is a vanilla function now
Browse files Browse the repository at this point in the history
Plus the modloader version is kinda sketchy with save data being inconsistent
  • Loading branch information
KnightMiner committed Sep 18, 2022
1 parent 0390f2f commit 71800fe
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions scripts/mod_loader/modapi/pawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,6 @@ BoardPawn.IsNeutral = function(self)
return neutral
end

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

if not Board or GetCurrentMission() == nil then
return
end

local ptable = self:GetPawnTable()
local powered = ptable.bPowered

if powered == nil then
powered = true
end

return powered
end

-- checks if the pawn receives psion effects
BoardPawn.CanMutate = function(self, targetPlayer)
Assert.Equals("userdata", type(self), "Argument #0")
Expand Down Expand Up @@ -477,20 +460,6 @@ local function initializeBoardPawn()
setSavefileFieldsForPawn(self, { bNeutral = neutral })
end

local oldSetPowered = pawn.SetPowered
BoardPawn.SetPowered = function(self, powered)
Assert.Equals("userdata", type(self), "Argument #0")
Assert.Equals("boolean", type(powered), "Argument #1")

oldSetPowered(self, powered)

if not Board or GetCurrentMission() == nil then
return
end

setSavefileFieldsForPawn(self, { bPowered = powered })
end

BoardPawn.IsPilotSkill = pawn.IsAbility
BoardPawn.GetPilotSkill = pawn.GetAbility

Expand Down

0 comments on commit 71800fe

Please sign in to comment.