fixed a bug with nunchucks not saving weapon speed. Updated libstormgames.

This commit is contained in:
Storm Dragon
2025-09-16 12:54:27 -04:00
parent 90f14b842e
commit bd298ab17e
2 changed files with 9 additions and 2 deletions

View File

@@ -101,6 +101,7 @@ class SaveManager:
"range": weapon.range,
"attackSound": weapon.attackSound,
"hitSound": weapon.hitSound,
"cooldown": weapon.cooldown,
"attackDuration": weapon.attackDuration,
"speedBonus": getattr(weapon, "speedBonus", 1.0),
"jumpDurationBonus": getattr(weapon, "jumpDurationBonus", 1.0),
@@ -117,18 +118,24 @@ class SaveManager:
# Handle backward compatibility for old saves
speedBonus = data.get("speedBonus", 1.0)
jumpDurationBonus = data.get("jumpDurationBonus", 1.0)
cooldown = data.get("cooldown", 500) # Default cooldown for old saves
# For old saves, restore proper bonuses for specific weapons
# For old saves, restore proper bonuses and cooldowns for specific weapons
if data["name"] == "witch_broom" and speedBonus == 1.0:
speedBonus = 1.17
jumpDurationBonus = 1.25
# Restore proper cooldown for nunchucks in old saves
if data["name"] == "nunchucks" and cooldown == 500:
cooldown = 250
weapon = Weapon(
name=data["name"],
damage=data["damage"],
range=data["range"],
attackSound=data["attackSound"],
hitSound=data["hitSound"],
cooldown=cooldown,
attackDuration=data["attackDuration"],
speedBonus=speedBonus,
jumpDurationBonus=jumpDurationBonus,