Mercurial > repos > IBBoard.WarFoundry.API
comparison api/Objects/Unit.cs @ 206:0ca96143aa03
Re #211: Swapping from percentage to numeric selection doesn't remove old selection
* Use Unit's "RemoveEquipmentItem" method instead of just removing from the equipment list and not the slot list
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 09 Nov 2009 12:20:34 +0000 |
parents | c0edb72a10ba |
children | e8e9026dd4ea |
comparison
equal
deleted
inserted
replaced
205:c0edb72a10ba | 206:0ca96143aa03 |
---|---|
338 //A UnitEquipmentItem shouldn't change its IsRatio value, so assume we already have the right sub-type | 338 //A UnitEquipmentItem shouldn't change its IsRatio value, so assume we already have the right sub-type |
339 currSelection.AmountTaken = amount; | 339 currSelection.AmountTaken = amount; |
340 } | 340 } |
341 else | 341 else |
342 { | 342 { |
343 equipment.Remove(equip); | 343 RemoveEquipmentItem(equip); |
344 AddEquipmentAmount(equip, amount); | 344 AddEquipmentAmount(equip, amount); |
345 } | 345 } |
346 | 346 |
347 OnUnitEquipmentAmountChanged(equip, oldAmount, amount); | 347 OnUnitEquipmentAmountChanged(equip, oldAmount, amount); |
348 } | 348 } |
399 { | 399 { |
400 currSelection.AmountTaken = ratio; | 400 currSelection.AmountTaken = ratio; |
401 } | 401 } |
402 else | 402 else |
403 { | 403 { |
404 equipment.Remove(equip); | 404 RemoveEquipmentItem(equip); |
405 AddEquipmentRatio(equip, ratio); | 405 AddEquipmentRatio(equip, ratio); |
406 } | 406 } |
407 | 407 |
408 OnUnitEquipmentAmountChanged(equip, oldRatio, ratio); | 408 OnUnitEquipmentAmountChanged(equip, oldRatio, ratio); |
409 } | 409 } |