isaacscript-common 1.2.49 → 1.2.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,14 +26,15 @@ function postPEffectUpdateReordered(self, player)
|
|
|
26
26
|
return
|
|
27
27
|
end
|
|
28
28
|
local playerIndex = getPlayerIndex(nil, player)
|
|
29
|
-
local
|
|
30
|
-
if
|
|
31
|
-
|
|
29
|
+
local playerHealthMap = v.run.playersHealthMap:get(playerIndex)
|
|
30
|
+
if playerHealthMap == nil then
|
|
31
|
+
playerHealthMap = __TS__New(Map)
|
|
32
32
|
end
|
|
33
33
|
local healthTypes = getEnumValues(nil, HealthType)
|
|
34
34
|
for ____, healthType in ipairs(healthTypes) do
|
|
35
|
-
local storedHealthValue =
|
|
35
|
+
local storedHealthValue = playerHealthMap:get(healthType)
|
|
36
36
|
local currentHealthValue = getCurrentHealthValue(nil, player, healthType)
|
|
37
|
+
playerHealthMap:set(healthType, currentHealthValue)
|
|
37
38
|
if storedHealthValue ~= nil and storedHealthValue ~= currentHealthValue then
|
|
38
39
|
local amount = currentHealthValue - storedHealthValue
|
|
39
40
|
postPlayerChangeHealthFire(nil, player, healthType, amount)
|
|
@@ -98,7 +99,7 @@ function getCurrentHealthValue(self, player, healthType)
|
|
|
98
99
|
end
|
|
99
100
|
until true
|
|
100
101
|
end
|
|
101
|
-
v = {run = {
|
|
102
|
+
v = {run = {playersHealthMap = __TS__New(Map)}}
|
|
102
103
|
function ____exports.postPlayerChangeHealthCallbackInit(self, mod)
|
|
103
104
|
saveDataManager(nil, "postPlayerChangeHealth", v, hasSubscriptions)
|
|
104
105
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
|