Improved cnc proc/harv docking.
This commit is contained in:
@@ -80,7 +80,22 @@ namespace OpenRA.Mods.RA
|
||||
if (!contents.ContainsKey(type.info)) contents[type.info] = 1;
|
||||
else contents[type.info]++;
|
||||
}
|
||||
|
||||
|
||||
// TODO: N-tick harvester unload.
|
||||
// Currently unloads everything in one go
|
||||
// Returns true when unloading is complete
|
||||
public bool TickUnload(Actor self, Actor proc)
|
||||
{
|
||||
if (!proc.IsInWorld)
|
||||
return false; // fail to deliver if there is no proc.
|
||||
|
||||
// TODO: Unload part of the load. Return false if the proc is full.
|
||||
proc.Trait<IAcceptOre>().GiveOre(contents.Sum(kv => kv.Key.ValuePerUnit * kv.Value));
|
||||
contents.Clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void Deliver(Actor self, Actor proc)
|
||||
{
|
||||
if (!proc.IsInWorld)
|
||||
|
||||
Reference in New Issue
Block a user