Skip to content

Commit

Permalink
Always move scrap metal to a cargo container whenever possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Teach committed Jul 18, 2011
1 parent 5056841 commit cec5cfd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Questor.Modules/ItemCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public bool IsContraband
}
}

public bool IsScrapMetal
{
get { return TypeId == 30497 || TypeId == 15331; }
}

public string Name
{
get { return _directItem.TypeName; }
Expand Down
15 changes: 13 additions & 2 deletions Questor.Modules/Salvage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,18 @@ private void LootWrecks()
// Build a list of items to loot
var lootItems = new List<ItemCache>();

// Dump scrap metal if we have any
if (containerEntity.Name == "Cargo Container" && shipsCargo.Any(i => i.IsScrapMetal))
{
foreach (var item in shipsCargo.Where(i => i.IsScrapMetal))
{
container.Add(item.DirectItem);
freeCargoCapacity += item.TotalVolume;
}

shipsCargo.RemoveAll(i => i.IsScrapMetal);
}

// Walk through the list of items ordered by highest value item first
foreach (var item in items.OrderByDescending(i => i.IskPerM3))
{
Expand All @@ -259,8 +271,7 @@ private void LootWrecks()
continue;

// We never want to pick up metal scraps
// TODO: Magic Numbers :/
if (item.TypeId == 30497 || item.TypeId == 15331)
if (item.IsScrapMetal)
continue;

// We pick up loot depending on isk per m3
Expand Down

0 comments on commit cec5cfd

Please sign in to comment.