From fcdb9cfe03d4682bdc6e68d5f93d78580f2cd237 Mon Sep 17 00:00:00 2001 From: WhiteFang Date: Sat, 6 Aug 2022 19:15:39 +0200 Subject: [PATCH] [PvPLeaderboard,PvPPunishment,GenericChatCommands] Fixed an issue with commands that lookup players by name; Bumped versions of each VMod --- CHANGELOG.md | 9 +++++++++ GenericChatCommands/GenericChatCommands.csproj | 2 +- PvPLeaderboard/PvPLeaderboard.csproj | 2 +- PvPPunishment/PvPPunishment.csproj | 2 +- Shared/VModCharacter.cs | 14 +++++++++++--- Thunderstore/GenericChatCommands/manifest.json | 2 +- Thunderstore/PvPLeaderboard/manifest.json | 2 +- Thunderstore/PvPPunishment/manifest.json | 2 +- 8 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e902fb..8ae1859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ * Initial release ## PvP Leaderboard +### v1.0.2 +* Fixed an issue with commands that lookup players by name + ### v1.0.1 * Fixed the logging of the incorrect current level in the grief-kill log (it logged the killer's lvl instead of the victim's) @@ -32,6 +35,9 @@ * Initial release ## PvP Punishment +### v1.0.4 +* Fixed an issue with commands that lookup players by name + ### v1.0.3 * Added a new config option to announce a grief-kill (exactly the same as the PvP Leaderboard mod v1.0.1) @@ -52,5 +58,8 @@ * Initial release ## Generic Chat Commands +### v1.0.1 +* Fixed an issue with commands that lookup players by name + ### v1.0.0 * Initial release diff --git a/GenericChatCommands/GenericChatCommands.csproj b/GenericChatCommands/GenericChatCommands.csproj index b379c58..dcf09ef 100644 --- a/GenericChatCommands/GenericChatCommands.csproj +++ b/GenericChatCommands/GenericChatCommands.csproj @@ -4,7 +4,7 @@ VMods.GenericChatCommands VMods.GenericChatCommands A mod that adds a number of generic/general usage commands - 1.0.0 + 1.0.1 true latest False diff --git a/PvPLeaderboard/PvPLeaderboard.csproj b/PvPLeaderboard/PvPLeaderboard.csproj index 8d771d8..005f2c5 100644 --- a/PvPLeaderboard/PvPLeaderboard.csproj +++ b/PvPLeaderboard/PvPLeaderboard.csproj @@ -4,7 +4,7 @@ VMods.PvPLeaderboard VMods.PvPLeaderboard A mod that keeps track of player's K/D and adds a pvp leaderboard - 1.0.1 + 1.0.2 true latest False diff --git a/PvPPunishment/PvPPunishment.csproj b/PvPPunishment/PvPPunishment.csproj index f3d6947..09554f7 100644 --- a/PvPPunishment/PvPPunishment.csproj +++ b/PvPPunishment/PvPPunishment.csproj @@ -4,7 +4,7 @@ VMods.PvPPunishment VMods.PvPPunishment A mod that punishes high-level players that kill low-level players - 1.0.3 + 1.0.4 true latest False diff --git a/Shared/VModCharacter.cs b/Shared/VModCharacter.cs index c4b65bc..c231a0a 100644 --- a/Shared/VModCharacter.cs +++ b/Shared/VModCharacter.cs @@ -87,11 +87,19 @@ public VModCharacter(Entity userEntity, Entity charEntity, EntityManager? entity foreach(var userEntity in users) { var userData = entityManager.Value.GetComponentData(userEntity); - var playerCharacter = entityManager.Value.GetComponentData(userData.LocalCharacter._Entity); - if(userData.CharacterName.ToString() == charactername) + if(userData.CharacterName.ToString() != charactername) { - return new VModCharacter(userData, playerCharacter); + continue; } + + var characterEntity = userData.LocalCharacter._Entity; + if(!entityManager.Value.HasComponent(characterEntity)) + { + continue; + } + + var playerCharacter = entityManager.Value.GetComponentData(characterEntity); + return new VModCharacter(userData, playerCharacter); } return null; } diff --git a/Thunderstore/GenericChatCommands/manifest.json b/Thunderstore/GenericChatCommands/manifest.json index 2580901..b44978f 100644 --- a/Thunderstore/GenericChatCommands/manifest.json +++ b/Thunderstore/GenericChatCommands/manifest.json @@ -1,7 +1,7 @@ { "name": "VMods_Generic_Chat_Commands", "description": "A mod that adds a fair amount of generic chat commands (mostly for Mods & Admins only though) and a player chat muting system.", - "version_number": "1.0.0", + "version_number": "1.0.1", "dependencies": [ "BepInEx-BepInExPack_V_Rising-1.0.0", "molenzwiebel-Wetstone-1.1.0" diff --git a/Thunderstore/PvPLeaderboard/manifest.json b/Thunderstore/PvPLeaderboard/manifest.json index 876aa6a..6d3a407 100644 --- a/Thunderstore/PvPLeaderboard/manifest.json +++ b/Thunderstore/PvPLeaderboard/manifest.json @@ -1,7 +1,7 @@ { "name": "VMods_PvP_Leaderboard", "description": "A mod that keeps track of Kills, Death and the K/D ratio of players and ranks them in a leaderboard.", - "version_number": "1.0.1", + "version_number": "1.0.2", "dependencies": [ "BepInEx-BepInExPack_V_Rising-1.0.0", "molenzwiebel-Wetstone-1.1.0" diff --git a/Thunderstore/PvPPunishment/manifest.json b/Thunderstore/PvPPunishment/manifest.json index 29779d1..6f702a3 100644 --- a/Thunderstore/PvPPunishment/manifest.json +++ b/Thunderstore/PvPPunishment/manifest.json @@ -1,7 +1,7 @@ { "name": "VMods_PvP_Punishment", "description": "A mod that punishes low-level kills.", - "version_number": "1.0.3", + "version_number": "1.0.4", "dependencies": [ "BepInEx-BepInExPack_V_Rising-1.0.0", "molenzwiebel-Wetstone-1.1.0"