Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smelting with HCFiresuit and getBurned function #91

Open
ttr opened this issue Dec 8, 2022 · 1 comment
Open

smelting with HCFiresuit and getBurned function #91

ttr opened this issue Dec 8, 2022 · 1 comment

Comments

@ttr
Copy link

ttr commented Dec 8, 2022

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants