Skip to content

Commit

Permalink
FIX: The number of goods in transit was miscounted in some cases
Browse files Browse the repository at this point in the history
CODE: Add Toshio Kuratomi to the credits as a tester.
  • Loading branch information
jamespetts committed Mar 15, 2017
1 parent e5aeb21 commit e1a8a0c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions scrolltext.h
Expand Up @@ -143,6 +143,7 @@
" Felix", "testing",
" Fam621", "testing",
" Accord 2", "testing",
" Toshio Kuratomi" "testing",
"","",
"","",
"Game Design Assistance:","",
Expand Down
19 changes: 19 additions & 0 deletions simhalt.cc
Expand Up @@ -1541,6 +1541,25 @@ uint32 haltestelle_t::reroute_goods(const uint8 catg)
// no connections from here => delete
delete new_warray;
new_warray = NULL;
ware_t ware;

for (uint32 i = 0; i < packet_count; i++)
{
ware = warray->get_element(i);
if (ware.is_freight())
{
const grund_t* gr = welt->lookup_kartenboden(ware.get_zielpos());
if (gr)
{
const gebaeude_t* building = gr->get_building();
const fabrik_t* fab = building ? building->get_fabrik() : NULL;
if (fab)
{
fab->update_transit(ware, false);
}
}
}
}
}
}

Expand Down

0 comments on commit e1a8a0c

Please sign in to comment.