Botania

Botania

133M Downloads

post increment instead of pre

Tebreca opened this issue ยท 2 comments

commented

https://github.com/Vazkii/Botania/blob/5393a5202a230a5f2391c0bbc465e6d8b4dc08df/src/main/java/vazkii/botania/client/fx/FXSparkle.java#L138

I was just looking around in the files as I want to do something similar for my own mod. But this instantly caught my eye, isn't this supposed to be if (++particleAge >= particleMaxAge) or even if (++particleAge == particleMaxAge)?
edit; I'm not trying to judge code, I'm wanting to improve my own code by looking at others' and i sometimes ask what's better

commented

in this case it doesn't really matter. It might be true that this lets the particle live one tick beyond the declared "maximum age" (but I think it doesn't due to the >=), but one extra tick (1/20 sec) of life doesn't really matter for a particle

commented

that's true,
thanks anyways!