(svn r8501) -Fix (r7377) [FS#539]: Keep track of how much cargo has been paid for, so that cargo cannot be paid for more than once.

This commit is contained in:
maedhros
2007-01-31 22:33:24 +00:00
parent 43242302e0
commit d8edc2bb98
5 changed files with 32 additions and 9 deletions

View File

@@ -1748,6 +1748,23 @@ bool AfterLoadGame(void)
}
}
if (CheckSavegameVersion(45)) {
Vehicle *v;
/* Originally just the fact that some cargo had been paid for was
* stored to stop people cheating and cashing in several times. This
* wasn't enough though as it was cleared when the vehicle started
* loading again, even if it didn't actually load anything, so now the
* amount of cargo that has been paid for is stored. */
FOR_ALL_VEHICLES(v) {
if (HASBIT(v->load_status, 2)) {
v->cargo_paid_for = v->cargo_count;
CLRBIT(v->load_status, 2);
} else {
v->cargo_paid_for = 0;
}
}
}
return true;
}