Fix uplink item spawning.
Actually spawns for the person who USES the uplink, not who owns it. Can't believe that was an actual bug. Also puts it in your active hand if possible.
This commit is contained in:
@@ -135,12 +135,20 @@ namespace Content.Server.GameObjects.Components.PDA
|
||||
|
||||
case PDAUplinkBuyListingMessage buyMsg:
|
||||
{
|
||||
if (!_uplinkManager.TryPurchaseItem(_syndicateUplinkAccount, buyMsg.ItemId))
|
||||
if (message.Session.AttachedEntity == null)
|
||||
break;
|
||||
|
||||
if (!_uplinkManager.TryPurchaseItem(_syndicateUplinkAccount, buyMsg.ItemId,
|
||||
message.Session.AttachedEntity.Transform.Coordinates, out var entity))
|
||||
{
|
||||
SendNetworkMessage(new PDAUplinkInsufficientFundsMessage(), message.Session.ConnectedClient);
|
||||
break;
|
||||
}
|
||||
|
||||
HandsComponent.PutInHandOrDropStatic(
|
||||
message.Session.AttachedEntity,
|
||||
entity.GetComponent<ItemComponent>());
|
||||
|
||||
SendNetworkMessage(new PDAUplinkBuySuccessMessage(), message.Session.ConnectedClient);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user