UltraMachine / rust-sc2

SC2 API for Rust
MIT License
38 stars 19 forks source link

`get_unit_cost` and zerg buildings #11

Closed vanderlokken closed 3 years ago

vanderlokken commented 3 years ago

The Bot::get_unit_cost method returns uncorrected values for zerg buildings, which include additional 50 minerals (the cost of a drone). For UnitTypeId::SpawningPool the returned value is 250. Since the aforementioned method is used to implement Bot::subtract_resources I'd suggest fixing this behaviour. It's counter-intuitive that Bot::subtract_resources(UnitTypeId::SpawningPool) subtracts 250 minerals, and the real mineral counter and the bot.minerals counter become out of sync for the rest of a step.

UltraMachine commented 3 years ago

Should be fixed now in e1187ea.

vanderlokken commented 3 years ago

Thank you. Can confirm: now it works as intended.