From 15548f6bef5c3f392b2fb66e41a7837e48e10206 Mon Sep 17 00:00:00 2001 From: srpg <44681214+srpg@users.noreply.github.com> Date: Mon, 21 Apr 2025 12:37:03 +0300 Subject: [PATCH] Fixed Source.Python not loading other games than css, tf2, csgo --- .../packages/source-python/weapons/instance.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/source-python/packages/source-python/weapons/instance.py b/addons/source-python/packages/source-python/weapons/instance.py index 10101cae1..90b68b8f6 100755 --- a/addons/source-python/packages/source-python/weapons/instance.py +++ b/addons/source-python/packages/source-python/weapons/instance.py @@ -8,6 +8,8 @@ # Source.Python Imports # Cvars from cvars import ConVar +# Core +from core import GAME_NAME # Weapons from weapons.constants import WeaponID from weapons.constants import WeaponSlot @@ -42,10 +44,13 @@ def __init__(self, name, basename, properties): # Store the weapon's type number self._type = self.parse_weapon_constants( properties.get('type', None), WeaponType) - - # Store the weapon's slot number - self._slot = self.parse_weapon_constants( + if GAME_NAME in ('cstrike', 'csgo', 'tf'): + # Store the weapon's slot number + self._slot = self.parse_weapon_constants( properties.get('slot', None), WeaponSlot) + else: + # Store the weapon's slot number + self._slot = properties.get('slot', None) # Store the weapon's max ammo amount self._maxammo = properties.get('maxammo', None)