Give: Zone.Remove ends the leaving giver's give GiverGone
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f0d7c12cbd
commit
4d462c771c
2 changed files with 6 additions and 3 deletions
|
|
@ -15,7 +15,8 @@ public enum GiveEnd
|
|||
ReceiverGone,
|
||||
ReceiverFull,
|
||||
NothingLeft,
|
||||
GiverDocked
|
||||
GiverDocked,
|
||||
GiverGone
|
||||
}
|
||||
|
||||
// A pilot's standing offer of goods to a ship alongside. Runtime only: nothing about a give is saved.
|
||||
|
|
|
|||
|
|
@ -299,11 +299,13 @@ public class Zone
|
|||
if (piloted) Agents.Add(CreateAgent((Ship) entity, task));
|
||||
}
|
||||
|
||||
// The one removal from this zone (death, dock, jump): membership and its death watch leave together. False, and
|
||||
// nothing changes, when the entity is not a member. The caller deactivates; Remove does not.
|
||||
// The one removal from this zone (death, dock, jump): membership and its death watch leave together, and so does the
|
||||
// entity's give, which ends GiverGone unless a dock already ended it. False, and nothing changes, when the entity is
|
||||
// not a member. The caller deactivates; Remove does not.
|
||||
public bool Remove(Entity entity)
|
||||
{
|
||||
if (!_entities.Remove(entity)) return false;
|
||||
CargoTransfer.End(entity, GiveEnd.GiverGone);
|
||||
_deathWatches.Remove(entity, out var watch);
|
||||
watch.Dispose();
|
||||
foreach (var floating in FloatingItems)
|
||||
|
|
|
|||
Loading…
Reference in a new issue