Harden Ymir contact consumption
This commit is contained in:
parent
4dc0c0faf7
commit
72128da11e
3 changed files with 38 additions and 8 deletions
|
|
@ -181,9 +181,13 @@ namespace GameCult.Aetheria.State.Verse
|
|||
!string.IsNullOrWhiteSpace(value.FactId)))
|
||||
{
|
||||
var entityIndex = contact.EntityAIndex >= 0 ? contact.EntityAIndex : contact.EntityBIndex;
|
||||
var contactEntityId = contact.EntityAIndex >= 0 ? contact.EntityAId : contact.EntityBId;
|
||||
entitiesByIndex.TryGetValue(entityIndex, out var entity);
|
||||
var entityId = entity?.EntityId ??
|
||||
(contact.EntityAIndex >= 0 ? contact.EntityAId : contact.EntityBId);
|
||||
if (entity != null && !string.Equals(contactEntityId, entity.EntityId, StringComparison.Ordinal))
|
||||
throw new InvalidOperationException(
|
||||
$"Ymir fact '{contact.FactId}' entity identity '{contactEntityId}' does not match " +
|
||||
$"live entity {entityIndex} identity '{entity.EntityId}'.");
|
||||
var entityId = entity?.EntityId ?? contactEntityId;
|
||||
var priorReceipt = AetheriaRuntimePickupContactReceipts.Find(run, contact.FactId);
|
||||
if (priorReceipt != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue