StrangeLoopGames / EcoIssues

131 stars 21 forks source link

[0.9.0 staging-1322] Work Party: Client crash with resources adding (reputation payment) #14297

Closed beastyn closed 4 years ago

beastyn commented 4 years ago
  1. Create a party with reputation payment
  2. Someone take it and try to place resources to the order, Crash

System.NullReferenceException: Object reference not set to an instance of an object. at Eco.Gameplay.Economy.WorkParties.ReputationPayment.PayUser(Laborer laborer, Single amount) at Eco.Gameplay.Economy.WorkParties.ValuePayment.WorkPerformed(Laborer laborer, Single percentPerformed) at Eco.Gameplay.Economy.WorkParties.WorkParty.<>c__DisplayClass43_0.b__0(Payment x) at System.Linq.Enumerable.SelectIListIterator2.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.ToArray() at Eco.Shared.Utils.StringExtensions.TextList(IEnumerable1 e, String sep) at Eco.Gameplay.Economy.WorkParties.WorkParty.OnWorkPerformed(User user, Work work, Single percentDelta, String message) at Eco.Gameplay.Economy.WorkParties.CollectResourcesWork.UpdateWorkDone(User user, Type item, Int32 quantity, String message) at Eco.Gameplay.Utils.ItemTracker.ActionPerformed(GameAction action) at Eco.Gameplay.Economy.WorkParties.CollectResourcesWork.ActionPerformed(GameAction action) at Eco.Shared.Utils.ListExtensions.ForEach[T](IList1 list, Action1 action) at Eco.Shared.Utils.EnumerableExtensions.ForEach[T](IEnumerable1 enumeration, Action1 action) at Eco.Gameplay.GameActions.ActionUtil.ActionPerformed(GameAction action) at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User user, IEnumerable1 actions, IEnumerable1 preTests, IEnumerable1 postEffects) at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User user, GameActionPack actionPack, Boolean notify) at Eco.Gameplay.GameActions.GameActionManager.TryPerform(GameActionPack pack, Boolean notify) at Eco.Gameplay.Items.WorkOrder.TryToContributeItemsResult(User user, ItemStack stack, Int32 maxToContribute, Boolean moveAll) at Eco.Gameplay.Items.WorkOrder.TryToContributeItems(Player player, ItemStack stack, Int32 maxToContribute, Boolean moveAll)

johnkslg commented 4 years ago

I cant repro this: image

Can you give more specific steps? From a newly spawned world

beastyn commented 4 years ago

Just make a party with 10 000 reputation for payment. https://drive.google.com/file/d/1ui_1suHQHsG--u_yFhvReMBFnXtpnR2f/view?usp=sharing

johnkslg commented 4 years ago

Ah the problem was happening when you switch the type of a payment (I was adding a new payment and that didnt trigger the problem). Found and fixed, thanks! image