fixed a bug with nunchucks not saving weapon speed. Updated libstormgames.
This commit is contained in:
Submodule libstormgames updated: 8cca66d44e...acb899e6eb
@@ -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,
|
||||
|
Reference in New Issue
Block a user