Jump to content

Typo in crabking.lua making crab's health scale twice as fast


Arcwell
  • Pending

In crabking.lua, there is a line that reads:

mob.components.health:SetMaxHealth(mob.components.health.currenthealth + (math.floor(inst.gemcount.purple+1/2) * TUNING.CRABKING_MOB_HEALTH_BONUS) )

Because there are no parentheses around inst.gem.count.purple+1, order of operations means 2 will only be divided from 1, not fromĀ inst.gem.count.purple+1. As such, math.floor will always return inst.gemcount.purple, meaning crab king mob health increases for each gem as opposed to each 2 gems.

To fix this, just put parentheses aroundĀ inst.gem.count.purple+1 like so:

mob.components.health:SetMaxHealth(mob.components.health.currenthealth + (math.floor((inst.gemcount.purple+1)/2) * TUNING.CRABKING_MOB_HEALTH_BONUS) )

Steps to Reproduce

Read code




User Feedback




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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...