Skip to content

Commit

Permalink
Store a reference to Board.SetNeutral
Browse files Browse the repository at this point in the history
Store a reference to Board.SetNeutral as Board.SetNeutralVanilla before overriding, so the override can be reverted
  • Loading branch information
Lemonymous committed Oct 26, 2022
1 parent aa1ba9d commit 51ec7e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/mod_loader/modapi/pawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ local function initializeBoardPawn()

local pawn = PAWN_FACTORY:CreatePawn("PunchMech")

local oldSetNeutral = pawn.SetNeutral
BoardPawn.SetNeutralVanilla = pawn.SetNeutral
BoardPawn.SetNeutral = function(self, neutral)
Assert.Equals("userdata", type(self), "Argument #0")
Assert.Equals("boolean", type(neutral), "Argument #1")
Expand Down

0 comments on commit 51ec7e9

Please sign in to comment.