summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-20 20:18:19 +0000
committerrubidium <rubidium@openttd.org>2012-01-20 20:18:19 +0000
commit70c7fbd90eb0ace75d759725ba4d0085283f152c (patch)
treef807e537b9e78dff6442d4ec2a472217e84157d4 /src/script
parent15331fa03c5bd87c54ea51e57a9738e867f6bc2e (diff)
downloadopenttd-70c7fbd90eb0ace75d759725ba4d0085283f152c.tar.xz
(svn r23826) -Fix [FS#4972]: the detailed performance rating window showed the cargo count of the current quarter instead of the last quarter like the tooltip says
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_company.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/api/script_company.cpp b/src/script/api/script_company.cpp
index dd79feb88..8e19904f9 100644
--- a/src/script/api/script_company.cpp
+++ b/src/script/api/script_company.cpp
@@ -138,9 +138,9 @@
if (quarter > EARLIEST_QUARTER) return -1;
if (quarter == CURRENT_QUARTER) {
- return ::Company::Get((::CompanyID)company)->cur_economy.delivered_cargo;
+ return ::Company::Get((::CompanyID)company)->cur_economy.delivered_cargo.GetSum<OverflowSafeInt<int32, INT32_MAX, INT32_MIN> >();
}
- return ::Company::Get((::CompanyID)company)->old_economy[quarter - 1].delivered_cargo;
+ return ::Company::Get((::CompanyID)company)->old_economy[quarter - 1].delivered_cargo.GetSum<OverflowSafeInt<int32, INT32_MAX, INT32_MIN> >();
}
/* static */ int32 ScriptCompany::GetQuarterlyPerformanceRating(ScriptCompany::CompanyID company, uint32 quarter)