FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed setting optional keyword arguments for the damage command · Zipcore/Source.Python@11ac938 · GitHub

Repository navigation

Commit 11ac938

Browse files
committed
Fixed setting optional keyword arguments for the damage command
Also removed the hasattr check, because we want to get notified if the keyword is not supported
1 parent afdb320 commit 11ac938

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

  • addons/source-python/packages/source-python/entities

‎addons/source-python/packages/source-python/entities/specials.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,8 @@ def damage(
107107
# Loop through the given keywords
108108
for item in kwargs:
109109

110-
# Is the keyword supported?
111-
if hasattr(take_damage_info, item):
112-
113-
# Set the offset's value
114-
getattr(take_damage_info, item, kwargs[item])
110+
# Set the offset's value
111+
setattr(take_damage_info, item, kwargs[item])
115112

116113
# Call the function with the victim's pointer and the CTakeDamageInfo
117114
victim.take_damage(take_damage_info)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL