Index cargo by typed item keys
This commit is contained in:
parent
8337d5f5c7
commit
df59a9da62
9 changed files with 120 additions and 51 deletions
|
|
@ -107,7 +107,7 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior
|
|||
var cargo = Entity.FindItemInCargo(_data.AmmoType);
|
||||
if (cargo != null)
|
||||
{
|
||||
var item = cargo.ItemsOfType[_data.AmmoType][0];
|
||||
var item = cargo.GetFirstItem(_data.AmmoType);
|
||||
if (item is SimpleCommodity simpleCommodity)
|
||||
cargo.Remove(simpleCommodity, 1);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue