summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-12-30 00:06:00 +0000
committerDarkvater <darkvater@openttd.org>2006-12-30 00:06:00 +0000
commit9dca03146bd1e7d9e0e07faa9d7cd4c5f5b06adb (patch)
tree8bdab3df7780cb619b47e314e40520b045478147 /economy.c
parentebca9d0c6b635b1a417c3efc00118c91d5bd10ec (diff)
downloadopenttd-9dca03146bd1e7d9e0e07faa9d7cd4c5f5b06adb.tar.xz
(svn r7630) -Fix: At the end of the quarter the old economy numbers were shifted up, and
the current economy numbers were moved to economy[0]. This was done in one memmove which worked because old_economy was behind cur_economy in the struct. Do not rely on this functionality...
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/economy.c b/economy.c
index 8839d7db1..8e8d8c3b8 100644
--- a/economy.c
+++ b/economy.c
@@ -589,17 +589,16 @@ static void PlayersGenStatistics(void)
FOR_ALL_PLAYERS(p) {
if (p->is_active) {
- memmove(&p->old_economy, &p->cur_economy, sizeof(p->old_economy));
+ memmove(&p->old_economy[1], &p->old_economy[0], sizeof(p->old_economy) - sizeof(p->old_economy[0]));
+ p->old_economy[0] = p->cur_economy;
memset(&p->cur_economy, 0, sizeof(p->cur_economy));
- if (p->num_valid_stat_ent != 24)
- p->num_valid_stat_ent++;
+ if (p->num_valid_stat_ent != 24) p->num_valid_stat_ent++;
UpdateCompanyRatingAndValue(p, true);
PlayersCheckBankrupt(p);
- if (p->block_preview != 0)
- p->block_preview--;
+ if (p->block_preview != 0) p->block_preview--;
}
}