public void ModuleSell(JournalModuleSell e) { ShipInformation sm = EnsureShip(e.ShipId); // this either gets current ship or makes a new one. Ships[e.ShipId] = sm.RemoveModule(e.Slot, e.SellItem); if (e.SellItem.Length > 0) { itemlocalisation[e.SellItem] = e.SellItemLocalised; } currentid = e.ShipId; // must be in it to do this }
public void ModuleSell(JournalModuleSell e) { string sid = Key(e.ShipFD, e.ShipId); ShipInformation sm = EnsureShip(sid); // this either gets current ship or makes a new one. sm = sm.SetShipDetails(e.Ship, e.ShipFD); // shallow copy if changed Ships[sid] = sm.RemoveModule(e.Slot, e.SellItem); if (e.SellItem.Length > 0) { itemlocalisation[e.SellItem] = e.SellItemLocalised; } VerifyList(); }