From f0ba8207e51db0ad4b27c44057f0f328daa40209 Mon Sep 17 00:00:00 2001 From: rick Date: Thu, 26 Dec 2024 00:14:29 +0800 Subject: [PATCH] fix: check valid before drug all --- l4d2_tank_draw/scripting/lib/lucky_draw.sp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/l4d2_tank_draw/scripting/lib/lucky_draw.sp b/l4d2_tank_draw/scripting/lib/lucky_draw.sp index 7ce093a..9dfc473 100644 --- a/l4d2_tank_draw/scripting/lib/lucky_draw.sp +++ b/l4d2_tank_draw/scripting/lib/lucky_draw.sp @@ -60,7 +60,10 @@ stock Action LuckyDraw(int victim, int attacker) { for (int i = 1; i <= MaxClients; i++) { - SetDrug(i, DrugAllSurvivorDuration.IntValue); + if (IsValidAliveClient(i)) + { + SetDrug(i, DrugAllSurvivorDuration.IntValue); + } } CPrintToChatAll("%t", "TankDrawResult_DrugAll", attackerName, DrugAllSurvivorDuration.IntValue);