Refactor stacks to not use method events (#4177)

This commit is contained in:
Vera Aguilera Puerto
2021-06-12 11:24:34 +02:00
committed by GitHub
parent ca4e665296
commit 0093a961bc
17 changed files with 79 additions and 248 deletions

View File

@@ -188,13 +188,12 @@ namespace Content.Server.Hands
}
else
{
var splitStack = new StackSplitEvent() { Amount = 1, SpawnPosition = playerEnt.Transform.Coordinates };
RaiseLocalEvent(throwEnt.Uid, splitStack);
var splitStack = Get<StackSystem>().Split(throwEnt.Uid, stackComp, 1, playerEnt.Transform.Coordinates);
if (splitStack.Result == null)
if (splitStack == null)
return false;
throwEnt = splitStack.Result;
throwEnt = splitStack;
}
var direction = coords.ToMapPos(EntityManager) - playerEnt.Transform.WorldPosition;