Skip to content

CS:GO weapons update #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 10, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Issue #153.
Added the ini ConfigObj to the weapon_manager instance.
  • Loading branch information
satoon101 committed Oct 7, 2016
commit a4d74a92d0cd27b366eb1650ff62875cb694d009
14 changes: 8 additions & 6 deletions addons/source-python/packages/source-python/weapons/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def __init__(self):
super().__init__()

# Get the ConfigObj instance of the file
ini = ConfigObj(_gamepath, unrepr=True)
self.ini = ConfigObj(_gamepath, unrepr=True)

# Get the "properties"
properties = ini['properties']
properties = self.ini['properties']

# Get the game's weapon prefix
self._prefix = properties['prefix']
Expand All @@ -61,22 +61,24 @@ def __init__(self):
self._myweapons = properties['myweapons']

# Store any special names
self._special_names = ini.get('special names', {})
self._special_names = self.ini.get('special names', {})

# Store projectile names
self._projectiles = ini.get('projectiles', {})
self._projectiles = self.ini.get('projectiles', {})

# Store tags as a set
self._tags = set()

# Loop through all weapons
for basename in ini['weapons']:
for basename in self.ini['weapons']:

# Get the weapon's full name
name = self._format_name(basename)

# Add the weapon to the dictionary
self[name] = WeaponClass(name, basename, ini['weapons'][basename])
self[name] = WeaponClass(
name, basename, self.ini['weapons'][basename]
)

# Add the weapon's tags to the set of tags
self._tags.update(self[name].tags)
Expand Down