-
Notifications
You must be signed in to change notification settings - Fork 24
halts count curve in citylist_frame #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: OTRP-KUTAv6
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4496,6 +4496,7 @@ void karte_t::update_history() | |
| { | ||
| finance_history_year[0][WORLD_CONVOIS] = finance_history_month[0][WORLD_CONVOIS] = convoi_array.get_count(); | ||
| finance_history_year[0][WORLD_FACTORIES] = finance_history_month[0][WORLD_FACTORIES] = fab_list.get_count(); | ||
| finance_history_year[0][WORLD_HALTS] = finance_history_month[0][WORLD_HALTS] = haltestelle_t::get_alle_haltestellen().get_count(); | ||
|
|
||
| // now step all towns (to generate passengers) | ||
| sint64 bev=0; | ||
|
|
@@ -4930,6 +4931,15 @@ DBG_MESSAGE("karte_t::save(loadsave_t *file)", "saved messages"); | |
| file->rdwr_longlong(finance_history_month[month][cost_type]); | ||
| } | ||
| } | ||
| // WORLD_HALTS added in OTRP v56 | ||
| if( file->get_OTRP_version()>55 ) { | ||
| for(int year = 0; year < /*MAX_WORLD_HISTORY_YEARS*/12; year++) { | ||
| file->rdwr_longlong(finance_history_year[year][WORLD_HALTS]); | ||
| } | ||
| for(int month = 0; month < /*MAX_WORLD_HISTORY_MONTHS*/12; month++) { | ||
| file->rdwr_longlong(finance_history_month[month][WORLD_HALTS]); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // finally a possible scenario | ||
|
|
@@ -5512,15 +5522,32 @@ DBG_MESSAGE("karte_t::load()", "%d factories loaded", fab_list.get_count()); | |
| } | ||
| else { | ||
| for (int year = 0; year</*MAX_WORLD_HISTORY_YEARS*/12; year++) { | ||
| for (int cost_type = 0; cost_type</*MAX_WORLD_COST*/12; cost_type++) { | ||
| for (int cost_type = 0; cost_type<WORLD_HALTS; cost_type++) { | ||
| file->rdwr_longlong(finance_history_year[year][cost_type]); | ||
| } | ||
| } | ||
| for (int month = 0;month</*MAX_WORLD_HISTORY_MONTHS*/12;month++) { | ||
| for (int cost_type = 0; cost_type</*MAX_WORLD_COST*/12; cost_type++) { | ||
| for (int cost_type = 0; cost_type<WORLD_HALTS; cost_type++) { | ||
| file->rdwr_longlong(finance_history_month[month][cost_type]); | ||
| } | ||
| } | ||
| // WORLD_HALTS added in OTRP v56; older files have no recorded data | ||
| if( file->get_OTRP_version() > 55 ) { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. セーブ/ロードのバージョン判定が不一致 — ファイル破壊バグ
しかし 修正: save側もguardしてください (Claude による自動レビュー) |
||
| for(int year = 0; year < /*MAX_WORLD_HISTORY_YEARS*/12; year++) { | ||
| file->rdwr_longlong(finance_history_year[year][WORLD_HALTS]); | ||
| } | ||
| for(int month = 0; month < /*MAX_WORLD_HISTORY_MONTHS*/12; month++) { | ||
| file->rdwr_longlong(finance_history_month[month][WORLD_HALTS]); | ||
| } | ||
| } | ||
| else { | ||
| for(int year = 0; year < /*MAX_WORLD_HISTORY_YEARS*/12; year++) { | ||
| finance_history_year[year][WORLD_HALTS] = 0; | ||
| } | ||
| for(int month = 0; month < /*MAX_WORLD_HISTORY_MONTHS*/12; month++) { | ||
| finance_history_month[month][WORLD_HALTS] = 0; | ||
| } | ||
| } | ||
| last_month_bev = finance_history_month[1][WORLD_CITIZENS]; | ||
|
|
||
| if (file->is_version_atleast(112, 5) && file->is_version_less(120, 6)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このコメントは「OTRP v56 で追加」と書いてありますが、
save()側(新 4934 行目付近)のコメントには「OTRP v55 で追加」と書かれており、矛盾しています。上の
> 55を>= 55に修正した場合、「v55 以降のファイルに記録されている」という意味になるので、こちらのコメントも「v55 で追加」に統一してください。(Claude による自動レビュー)