Fixed Adrenaline still sometimes being placed as an int and breaking stuff, notably in addons like Infernum (whom discovered the bug)
This commit is contained in:
1 parent
d07e7060b3
commit
a307722542
1 file changed
+7
-8
@@ -1312,15 +1312,14 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (tag.ContainsKey("adrenaline"))
|
||||
{
|
||||
bool failedToLoadFloatAdrenaline = false;
|
||||
try
|
||||
{
|
||||
adrenaline = tag.GetFloat("adrenaline");
|
||||
}
|
||||
catch (Exception) { failedToLoadFloatAdrenaline = true; }
|
||||
object adrenObj = tag["adrenaline"];
|
||||
|
||||
if (failedToLoadFloatAdrenaline)
|
||||
adrenaline = tag.GetInt("adrenaline") / (10000 / 100f);
|
||||
if (adrenObj is float adrenFloat)
|
||||
adrenaline = adrenFloat;
|
||||
else if (adrenObj is int adrenInt)
|
||||
adrenaline = adrenInt;
|
||||
else
|
||||
adrenaline = 0f;
|
||||
}
|
||||
|
||||
if (tag.ContainsKey("aquaticBoostPower"))
|
||||
|
||||
Reference in new issue
Block a user