So for the case we're interested in,
iMaxOverflow = iProductionNeeded
iMaxOverflowForGold = iProductionNeeded
iOverflow = iMaxOverflow (in the case we're interested in)
iOverflow > 0
so I assume this line means iOverflow is reduced if the hammer multiplier was greater than 0%
iProductionGold = max(0,(some number less than or equal to iProductionNeeded) - iProductionNeeded) = max(0, some number that cannot be greater than 0) = 0 (uh oh!)
iMaxOverflow = iProductionNeeded
iMaxOverflowForGold = iProductionNeeded
iOverflow = iMaxOverflow (in the case we're interested in)
iOverflow > 0
so I assume this line means iOverflow is reduced if the hammer multiplier was greater than 0%
iProductionGold = max(0,(some number less than or equal to iProductionNeeded) - iProductionNeeded) = max(0, some number that cannot be greater than 0) = 0 (uh oh!)