Skip to content
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

Fixes weapon restriction #184

Merged

Conversation

ThaPwned
Copy link
Contributor

@ThaPwned ThaPwned commented Feb 9, 2017

@satoon101
Copy link
Member

This will have the same issue that already exists, as it is still clearing the _TeamRestrictions dictionaries. The for loop is fine by itself as a fix, or you can instead override _TeamRestrictions.clear() to do the same for loop internally. I think option 2 would be the better choice in case other developers want to override WeaponRestrictionHandler's clear method.

@ThaPwned
Copy link
Contributor Author

ThaPwned commented Feb 9, 2017

This will have the same issue that already exists

It won't. Have been running my test server with the code for quite a while now without any exceptions but I'll update the code with your suggestion.

@satoon101
Copy link
Member

You must not have tested with a map change, then.

In OnLevelInit, we clear the all of the registered handlers. So, that in turn clears the team_restrictions of all items for each handler. Since there are no more items in the team_restrictions, __getitem__ will error whether you pass a team number or an alias.

Thank you for the update!

@satoon101 satoon101 merged commit 4c4c307 into Source-Python-Dev-Team:master Feb 9, 2017
@ThaPwned
Copy link
Contributor Author

I could've sworn it did... I take my statement back.

Thank you for the update!

You're welcome.

@ThaPwned ThaPwned deleted the weapon_restrict_fix branch February 10, 2017 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants