mirror of
https://github.com/creazy231/cs2-css-flashlight.git
synced 2026-09-27 20:17:04 +02:00
Fix server crash on some systems
This commit is contained in:
parent
f5a81d0b50
commit
95c459f931
1 changed files with 6 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ public class Flashlight : BasePlugin
|
|||
public override string ModuleAuthor => "creazy.eth";
|
||||
public override string ModuleName => "Flashlight";
|
||||
public override string ModuleDescription => "Flashlight for Counter-Strike 2";
|
||||
public override string ModuleVersion => "0.0.3";
|
||||
public override string ModuleVersion => "0.0.4";
|
||||
|
||||
private static string ModuleDisplayName => "Flashlight";
|
||||
|
||||
|
|
@ -30,12 +30,14 @@ public class Flashlight : BasePlugin
|
|||
|
||||
public override void Load(bool hotReload)
|
||||
{
|
||||
LogHelper.LogToConsole(ConsoleColor.Green, $"{ModuleName} version {ModuleVersion} loaded");
|
||||
|
||||
Instance = this;
|
||||
|
||||
LogHelper.LogToConsole(ConsoleColor.Green, $"{ModuleName} v{ModuleVersion} loading...");
|
||||
|
||||
RegisterListener<Listeners.OnTick>(() =>
|
||||
{
|
||||
if (_connectedPlayers.Count == 0) return;
|
||||
|
||||
foreach (var player in _connectedPlayers.Where(player => player is { IsValid: true, IsBot: false, PawnIsAlive: true }))
|
||||
{
|
||||
ToggleFlashlight(player);
|
||||
|
|
@ -77,7 +79,7 @@ public class Flashlight : BasePlugin
|
|||
}
|
||||
});
|
||||
|
||||
LogHelper.LogToChatAll($"{ModuleDisplayName} v{ModuleVersion} loaded!");
|
||||
LogHelper.LogToConsole($"{ModuleDisplayName} v{ModuleVersion} loaded!");
|
||||
}
|
||||
|
||||
[GameEventHandler]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue