Skip to content

Commit

Permalink
Add resetting of tmeporary stats on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Sep 28, 2024
1 parent 83a6d34 commit 18d4964
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Linq;
using System.Threading.Tasks;
using Edelstein.Common.Gameplay.Entities.Modifiers;
using Edelstein.Common.Gameplay.Handling.Pipes;
using Edelstein.Protocol.Gameplay.Contracts;
using Edelstein.Protocol.Gameplay.Entities;
using Edelstein.Protocol.Gameplay.Game;
using Edelstein.Protocol.Gameplay.Game.Objects.Users;
using Edelstein.Protocol.Services.Session;
using Edelstein.Protocol.Utilities.Pipelines;

Expand All @@ -24,6 +26,8 @@ public override async Task Handle(IPipelineContext ctx, UserOnDisconnect<IGameSt
{
if (message.User.Character != null)
{
new ModifyTemporaryStatContext(message.User.Character.TemporaryStats).ResetAll();

message.User.Character.FieldID = message.User.FieldUser.Field.Template.ForcedReturn ?? message.User.FieldUser.Field.Template.ID;
message.User.Character.FieldPortal = (byte)(message.User.FieldUser.Field.Template.ForcedReturn != null
? 0
Expand Down

0 comments on commit 18d4964

Please sign in to comment.