robotex140 / Hydrocraft

25 stars 38 forks source link

smelting with HCFiresuit and getBurned function #91

Open ttr opened 1 year ago

ttr commented 1 year ago

Hey, Was looking into code and had two observations about getBurned function: 1) would not this make full protection only for right hand ?: if itemType == "HCFiresuit" then bodyProtection[1]=200; break end https://github.com/robotex140/Hydrocraft/blob/main/Contents/mods/Hydrocraft/media/lua/server/HCFire.lua#L26-L28

Also, since HCFiresuit supposed to prevent to get burned at all, would not make more sense to actually break out from function all together after finding it? no point of all other calculation when in the end burn is caped to 100 and protection is 200 (and that was my 2nd observation)

HugoQwerty commented 1 year ago

burnPower=burnPower-bodyProtection[count] - ZombRand(10);

This line means the first loop ensure the burnPower will never be > 0, so it gives 100% protection. You're right though, it looks likes it could just return if the fire suit is being worm as the rest won't apply.