Closed Samasaur1 closed 6 years ago
Has now been isolated to this function
public static SimpleDate nextDay(SimpleDate old) {
old.dayOfMonth += 1;
if (old.getDayOfMonth() > old.month.getNumberOfDays()) {
old.dayOfMonth = 1;
int newMonth = monthToNumber(old.getMonth()) + 1;
int newYear = old.getYear();
while (newMonth > 12) {
newMonth -= 12;
newYear += 1;
}
old.setDate(newMonth, old.getDayOfMonth(), newYear);
}
return old;
}
and it occurs immediately on the first line, which (coincidentally) moves the date itself forward one day. The problem may be because I am changing the passed in date, but it may be because this value is being set to the birthday.
Even after 0f9d2e36e45a66f305f15aac0284bec36e1dbf3b and 595f3b9ba8902629d632a6603e84e35cd81c44a5 (and testing of them), this is not fixed. I believe that proceedOneDay
is being called on the birthdays somewhere.
Fixed in c302268b2a8f607f718b836dbecf840bf6a0c11a. I was referencing the actual date... It now makes a copy.
Currently, every day, all citizens' birthdays change to the new date. That means they get 'a year' older every day. I've isolated it to this method (line 129, SimpleDate.java)
and it appears to be when the line
is called. This is kind of important.