Closed ProgrammerDan closed 8 years ago
Already now what the issue is, which server is this for?
Devoted. Fix already merged? I haven't updated Citadel since that server went live.
https://github.com/Civcraft/Citadel/blob/master/src/vg/civcraft/mc/citadel/Utility.java#L296
I assume this is rounding down to 0. Is his maturation time for a reinforcement == 0. Honestly I think that login right there needs to be rewritten if you want to take a look at it.
None of the configured reinforcements have a maturation time of 0, so I'll have to investigate closer. Could be parse error or who knows what
Any luck tracking this down?
I think an earlier revision of the configuration had a number of block types with maturation time of "0" -- and everytime someone interacts with those blocks, this exception is thrown.
Definitely this block should be wrapped with divide-by-zero sanity check, but at least for Devoted looks like I'll just "fix" it in the database layer.
Sound reasonable?
Sure, want to fix it in citadel too?
Yeah, I'll take care of it :)
Spent some time on this (finally): https://trello.com/c/i57EkarT/32-scaled-citadel-maturation-is-100-broken
Basically the math was wrong, damage rate would have increased as the block got more mature, instead of decreasing, and integer math always produces integers immediately in java, so all the "percentage" math was just resolving to 0, leading to the divide-by-zero.
Now the math is done with explicit double casting, and truncated to integers only after everything is computed.
Fix: https://github.com/Civcraft/Citadel/tree/maturation_Fix
Can this be closed?
Yeah, I think we merged that fix
Placeholder so I can look at this later.