Closed samwho closed 2 years ago
pub fn can_build(&self, game_map: &GameMap) -> bool { let ref cell = game_map[self.pos]; self.unit_type == UnitType::Worker && !cell.has_resource() && self.can_act() && self.cargo_space_used() > City::city_build_cost() }
That last check, self.cargo_space_used() > City::city_build_cost(), will never be true. Workers can only carry 100, and the city build cost is 100. If I change this to be >= it works.
self.cargo_space_used() > City::city_build_cost()
>=
Hi, @samwho! Yeah, you right, this actually should be >=, created PR that fixeds it.
thanks! closed by #161
Thank you for the quick turnaround on this!
That last check,
self.cargo_space_used() > City::city_build_cost()
, will never be true. Workers can only carry 100, and the city build cost is 100. If I change this to be>=
it works.