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:
soul 2026-10-22 21:10:09 +02:00
commit 4d462c771c
2 changed files with 6 additions and 3 deletions

View file

@ -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.

View file

@ -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)