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

Fix bug in gun variant validator script #74727

Merged
Merged
Changes from all commits
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
7 changes: 3 additions & 4 deletions tools/json_tools/gun_variant_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,10 @@ def simplify_object(jo):
return False

req_keys = {"weight", "volume", "ammo", "id"}
extra_keys = {"longest_side", "pocket_data", "ranged_damage", "modes",
"recoil", "dispersion", "name"}
all_keys = req_keys | set(INHERITED_KEYS)

# Drop all the other keys
removed = list(filter(lambda key: key not in req_keys | extra_keys,
jo.keys()))
removed = list(filter(lambda key: key not in all_keys, jo.keys()))
# Need to iterate over removed because we can't delete from dict in for
for key in removed:
del jo[key]
Expand Down
Loading