mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-22 13:36:14 +02:00
CLOSES #1478, CLOSES #1479, CLOSES #1488, CLOSES #1510, CLOSES #1511, CLOSES #1514, CLOSES #1521, CLOSES #1522, CLOSES #1545, CLOSES #1557, CLOSES #1563, CLOSES #1565, CLOSES #1566, CLOSES #1577, CLOSES #1594, CLOSES #1596, CLOSES #1606, CLOSES #1608
This commit is contained in:
@@ -6017,8 +6017,14 @@ function World:trainerWinLossText()
|
||||
if not vm then return nil, nil end
|
||||
local obj = vm.trainerObject or {}
|
||||
local text = self.text or {}
|
||||
local winKey = vm.winTextOverride or obj.winText
|
||||
local lossKey = vm.lossTextOverride or obj.lossText
|
||||
-- `winlosstext` writes BOTH pointers; a 0 argument destroys the struct
|
||||
-- value rather than falling back to it (engine/overworld/scripting.asm:651)
|
||||
local winKey, lossKey
|
||||
if vm.winLossArmed then
|
||||
winKey, lossKey = vm.winTextOverride, vm.lossTextOverride
|
||||
else
|
||||
winKey, lossKey = obj.winText, obj.lossText
|
||||
end
|
||||
return winKey and text[winKey] or nil, lossKey and text[lossKey] or nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user