-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CN UPDATE] Client:2.3.21 Data:24-08-13-15-06-47-45c4b4
- Loading branch information
MuelsyseBot_v1
committed
Aug 15, 2024
1 parent
bd4f4ce
commit 0e85a16
Showing
52 changed files
with
253,931 additions
and
49,413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
zh_CN/gamedata/[uc]lua/hotfixes/SandboxBattleDataControllerHotfixer.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
local SandboxBattleDataControllerHotfixer = Class("SandboxBattleDataControllerHotfixer", HotfixBase) | ||
|
||
local function RecordUsingConstructItemFix(self, character) | ||
local gameMode = self.m_gameMode | ||
if character ~= nil and character.data ~= nil and gameMode ~= nil and gameMode.configData ~= nil and not gameMode.isInBuildType then | ||
local itemId = CS.Torappu.Battle.Sandbox.SandboxBattleUtil.GetTrapItemId(character, gameMode.configData) | ||
local output = self.m_output | ||
if itemId ~= nil and output ~= nil then | ||
local constructItems = output.constructItems | ||
if constructItems ~= nil then | ||
local itemCnt = constructItems:get_Item(itemId) | ||
if itemCnt ~= nil then | ||
local sourceCard = CS.Torappu.Battle.BattleController.instance:GetDeck(CS.Torappu.PlayerSide.DEFAULT):FindCard(character.data.uniqueId) | ||
if sourceCard ~= nil and sourceCard.remainingCnt == itemCnt then | ||
return | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
self:RecordUsingConstructItem(character) | ||
end | ||
|
||
function SandboxBattleDataControllerHotfixer:OnInit() | ||
xlua.private_accessible(CS.Torappu.Battle.Sandbox.SandboxBattleDataController) | ||
xlua.private_accessible(CS.Torappu.Battle.GameMode.GameModeFactory.SandboxGameMode) | ||
xlua.private_accessible(CS.Torappu.SandboxV2Data) | ||
xlua.private_accessible(CS.Torappu.Battle.Character) | ||
|
||
self:Fix_ex(CS.Torappu.Battle.Sandbox.SandboxBattleDataController, "RecordUsingConstructItem", function(self, character) | ||
local ok, errorInfo = xpcall(RecordUsingConstructItemFix, debug.traceback, self, character) | ||
if not ok then | ||
LogError("[SandboxBattleDataControllerHotfixer] fix" .. errorInfo) | ||
end | ||
end) | ||
end | ||
|
||
function SandboxBattleDataControllerHotfixer:OnDispose() | ||
end | ||
|
||
return SandboxBattleDataControllerHotfixer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.