Skip to content

Commit 89ced83

Browse files
fix Inventory property returning ItemBase instead of Item
1 parent 8c726ec commit 89ced83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TokenSystem/Tokens/ExpressionTokens/PlayerExpressionToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class Info<T>(Func<Player, T> handler, string? description) : Info
8888
[PlayerProperty.Role] = new Info<TextValue>(plr => plr.Role.ToString(), $"Player role type ({nameof(RoleTypeId)} enum value)"),
8989
[PlayerProperty.RoleRef] = new Info<ReferenceValue>(plr => new(plr.RoleBase), $"Reference to {nameof(PlayerRoleBase)}"),
9090
[PlayerProperty.Team] = new Info<TextValue>(plr => plr.Team.ToString(), $"Player team ({nameof(Team)} enum value)"),
91-
[PlayerProperty.Inventory] = new Info<CollectionValue>(plr => new(plr.Inventory.UserInventory.Items.Values.ToArray()), $"A collection of references to {nameof(ItemBase)} objects"),
91+
[PlayerProperty.Inventory] = new Info<CollectionValue>(plr => new(plr.Inventory.UserInventory.Items.Values.Select(Item.Get).RemoveNulls()), $"A collection of references to {nameof(Item)} objects"),
9292
[PlayerProperty.ItemCount] = new Info<NumberValue>(plr => (decimal)plr.Inventory.UserInventory.Items.Count, null),
9393
[PlayerProperty.HeldItemRef] = new Info<ReferenceValue>(plr => new(plr.CurrentItem), "A reference to the item the player is holding"),
9494
[PlayerProperty.IsAlive] = new Info<BoolValue>(plr => plr.IsAlive, null),

0 commit comments

Comments
 (0)