Unstable 1.2.4.0
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#nullable enable
|
||||
using Barotrauma.Networking;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma;
|
||||
|
||||
partial class HighlightAction : EventAction
|
||||
{
|
||||
partial void SetHighlightProjSpecific(Entity entity, IEnumerable<Character>? targetCharacters)
|
||||
{
|
||||
if (entity is Item item && GameMain.Server != null)
|
||||
{
|
||||
IEnumerable<Client>? targetClients = null;
|
||||
if (targetCharacters != null)
|
||||
{
|
||||
targetClients = targetCharacters
|
||||
.Select(c => GameMain.Server.ConnectedClients.FirstOrDefault(client => client.Character == c))
|
||||
.Where(c => c != null)!;
|
||||
}
|
||||
GameMain.Server?.CreateEntityEvent(item, new Item.SetHighlightEventData(State, highlightColor, targetClients));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user