SOSCSRPG icon indicating copy to clipboard operation
SOSCSRPG copied to clipboard

When cloning GameItems, also clone their Action objects

Open ScottLilly opened this issue 5 years ago • 0 comments

When cloning GameItems, we need to also clone their Action objects, to prevent problems with event subscriptions.

Change it to something like the below (adding in whatever is needed to handle different types of GameItems and Actions): Weapon clonedWeapon = new Weapon(ItemID, Name, Price, MinimumDamage, MaximumDamage, DamageType, WeaponSpeed, MissRate); clonedWeapon.Action = new AttackWithWeapon(clonedWeapon);

ScottLilly avatar Dec 24 '20 23:12 ScottLilly