MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / reload

Method reload

game/state/city/vequipment.cpp:190–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190int VEquipment::reload(int ammoAvailable)
191{
192 // TODO implement proper reloading speed. Now it is instant
193 int ammoRequired = this->type->max_ammo - this->ammo;
194 int reloadAmount = std::min(ammoRequired, ammoAvailable);
195 this->ammo += reloadAmount;
196 return reloadAmount;
197}
198
199bool VEquipment::reload(GameState &state, StateRef<Base> base)
200{

Callers 1

updateEndOfSecondMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected