Within the batbat.lua within onattack you do:
if owner.components.health ~= nil and owner.components.health:GetPercent() < 1 and not (target:HasTag("wall") or target:HasTag("engineering")) then owner.components.health:DoDelta(TUNING.BATBAT_DRAIN, false, "batbat") owner.components.sanity:DoDelta(-.5 * TUNING.BATBAT_DRAIN) end
So you are checking if health~=nil , but you forgot to check if sanity~=nil.
Mods which allow mobs or other things without sanity to carry a batbat, the game will crash on attack.
Please let me know if this is a kind of bugreport you would like to receive, or if you want the modders itself to implement some kind of security checks/workarounds, although this would mean alot of unnecessary code and overwrites.
Similar problems apply to some other files, eg. chest_random_good.lua where you should add security checks for all the mentioned components (although this is not that important, since it is not used in default DST as far as I know)
Steps to Reproduce
see above
see above
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now