Skip to content

Commit

Permalink
#340 Fix fetchRef failure.
Browse files Browse the repository at this point in the history
The issue was caused by 0 amount and underlying assert in the constructor of FetchOrder.
  • Loading branch information
zuev93 committed Apr 5, 2024
1 parent 0bc9ac2 commit 8099b6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/MultiplayerMod/Multiplayer/Commands/ArgumentUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public object ResolveRaw() {

var fetchOrders = list?.FetchOrders ?? creatureDeliveryPoint?.fetches;
if (fetchOrders == null) {
return new FetchOrder2(null, null, FetchChore.MatchCriteria.MatchTags, null, null, null, 0);
return new FetchOrder2(null, Tags, FetchChore.MatchCriteria.MatchTags, null, null, null, 1);
}
return fetchOrders.Single(order => order.Tags.SequenceEqual(Tags));
}
Expand Down
3 changes: 1 addition & 2 deletions src/MultiplayerMod/Multiplayer/Objects/MultiplayerObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public MultiplayerId Register(object instance, MultiplayerId? multiplayerId) {
public void Remove(MultiplayerId id) => extensions.Remove(id);

public T Get<T>(MultiplayerId id) {
extensions.TryGetKey(id, out var result);
return (T) result!;
return (T)extensions[id];
}

public object? this[MultiplayerId id] {
Expand Down

0 comments on commit 8099b6e

Please sign in to comment.