itb-community / ITB-ModLoader

A lua-based mod loader for the game Into the Breach
48 stars 17 forks source link

SafeDamage is not safe #223

Open Lemonymous opened 1 month ago

Lemonymous commented 1 month ago

SkillEffect.AddSafeDamage, SkillEffect.QueuedSafeDamage and Pawn.ApplyDamage are all broken, and are not safe to call to deal damage without potentially destroying terrain.

All of these functions are based on SkillEffect.AddSafeDamage.

SkillEffect.AddSafeDamage works by repairing destructible terrain after dealing the damage.

Cracked tiles was added with the Advanced Edition, which makes any terrain destructible. This is not taken into account with the safe damage function.

In order for these functions to work as advertised, they would have to be updated to account for cracked tiles in some way.