Re:The Wi Flag -Turns out some players in Asheron's Call wer...
by ok_dad on Friday February 10, 2023 @01:16PM
(#34743438)
I was waiting for them to say something like "then we take the random variable and multiply it by 3 to correct for this" and then explain some other, more subtle, bug. Looks like we all make stupid mistakes like this sometimes. I made a bug where I tried to get the month number for the next month, so you had to wrap at 12, but I just did "(current_month + 1) % 12" and left it at that, thinking for some reason that modulo works differently than it does in reality. Some stuff broke recently, due to that, and it was quite embarrassing.
[ Parent
| on HN ]
Re:The Wi Flag -Turns out some players in Asheron's Call wer...
by Aloisius on Friday February 10, 2023 @01:45PM
(#34743886)
I must be missing something. That is how modulo works. Well as long as January is month 0.
Re:The Wi Flag -Turns out some players in Asheron's Call wer...
by SoftAnnaLee on Friday February 10, 2023 @02:10PM
(#34744225)
It seems that the issue is that `January === 1`; so when you get to December (i.e. `12`) it rolls over to 0 rather than remaining as 12.
Re:The Wi Flag -Turns out some players in Asheron's Call wer...
by thaumasiotes on Friday February 10, 2023 @07:46PM
(#34748222)
You want (current_month % 12) + 1.