Skip to content

Commit 0806726

Browse files
author
s.kushnirenko
committed
Fix #643. Industry cart pushers carrying more than one load per trip.
Cap common_spawn_goods_output_cartpusher at UNITS_PER_LOAD so hunting lodge and similar buildings match vanilla 100-unit cart loads.
1 parent 24331f1 commit 0806726

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/building/building.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,8 @@ figure* building::common_spawn_goods_output_cartpusher(int min_carry, int max_ca
823823

824824
int stored_resources = stored_amount(output.resource);
825825
if (stored_resources >= min_carry) {
826-
int amounts_to_carry = std::min<int>(stored_resources, max_carry);
826+
const int carry_cap = std::min(max_carry, UNITS_PER_LOAD);
827+
int amounts_to_carry = std::min<int>(stored_resources, carry_cap);
827828
amounts_to_carry -= amounts_to_carry % 100; // remove pittance
828829

829830
figure* f = create_cartpusher(output.resource, amounts_to_carry, (e_figure_action)ACTION_20_CARTPUSHER_INITIAL, BUILDING_SLOT_CARTPUSHER);

src/building/building.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class building {
334334
int figure_spawn_timer();
335335
void check_labor_problem();
336336
void common_spawn_labor_seeker(int min_houses);
337-
figure* common_spawn_goods_output_cartpusher(int min_carry = 100, int max_carry = 800);
337+
figure* common_spawn_goods_output_cartpusher(int min_carry = 100, int max_carry = 100);
338338
bool workshop_has_resources();
339339

340340
void force_damage(e_damage_type type, int16_t value);

0 commit comments

Comments
 (0)