From 0af9177f07a57e20ff8d2d8ae05aa147b4e44c6a Mon Sep 17 00:00:00 2001
From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com>
Date: Wed, 27 Mar 2024 23:19:24 +0100
Subject: [PATCH] 2.3c
- Small change for mysql performance
---
Events.cs | 4 +++-
VERSION | 2 +-
WeaponPaints.cs | 6 ++++--
WeaponPaints.csproj | 2 +-
WeaponSynchronization.cs | 1 +
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/Events.cs b/Events.cs
index e7477f28..608a11ba 100644
--- a/Events.cs
+++ b/Events.cs
@@ -305,6 +305,8 @@ namespace WeaponPaints
private void OnTick()
{
+ if (!Config.Additional.ShowSkinImage) return;
+
foreach (var player in Utilities.GetPlayers().Where(p =>
p is not null && p.IsValid && p.PlayerPawn != null && p.PlayerPawn.IsValid &&
(LifeState_t)p.LifeState == LifeState_t.LIFE_ALIVE && p.SteamID.ToString().Length == 17
@@ -312,7 +314,7 @@ namespace WeaponPaints
)
)
{
- if (Config.Additional.ShowSkinImage && PlayerWeaponImage.TryGetValue(player.Slot, out string? value) && !string.IsNullOrEmpty(value))
+ if (PlayerWeaponImage.TryGetValue(player.Slot, out string? value) && !string.IsNullOrEmpty(value))
{
player.PrintToCenterHtml("
".Replace("{PATH}", value));
}
diff --git a/VERSION b/VERSION
index 2fcdc9e8..d580a15f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.3b
\ No newline at end of file
+2.3c
\ No newline at end of file
diff --git a/WeaponPaints.cs b/WeaponPaints.cs
index 8da76f0f..4bec9b3f 100644
--- a/WeaponPaints.cs
+++ b/WeaponPaints.cs
@@ -160,7 +160,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig "Nereziel & daffyy";
public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based";
public override string ModuleName => "WeaponPaints";
- public override string ModuleVersion => "2.3b";
+ public override string ModuleVersion => "2.3c";
public static WeaponPaintsConfig GetWeaponPaintsConfig()
{
@@ -258,7 +258,9 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig
-
+
diff --git a/WeaponSynchronization.cs b/WeaponSynchronization.cs
index eb9e3f6b..90dcce10 100644
--- a/WeaponSynchronization.cs
+++ b/WeaponSynchronization.cs
@@ -233,6 +233,7 @@ namespace WeaponPaints
string query;
object parameters;
+
if (existingRecordCount > 0)
{
query = "UPDATE `wp_player_skins` SET `weapon_paint_id` = @paintId, `weapon_wear` = @wear, `weapon_seed` = @seed WHERE `steamid` = @steamid AND `weapon_defindex` = @weaponDefIndex";