Skip to content

Fixed an animation error when setting a model to Player. #435

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 2 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions addons/source-python/data/source-python/entities/bms/CBaseEntity.ini
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[virtual_function]

# _ZN11CBaseEntity8SetModelEPKc
[[set_model]]
offset_linux = 27
offset_windows = 26
arguments = STRING

# _ZN11CBaseEntity9SetParentEPS_i
[[set_parent]]
offset_linux = 38
Expand Down
6 changes: 6 additions & 0 deletions addons/source-python/data/source-python/entities/csgo/CBaseEntity.ini
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ srv_check = False

[virtual_function]

# _ZN11CBaseEntity8SetModelEPKc
[[set_model]]
offset_linux = 28
offset_windows = 27
arguments = STRING

# _ZN11CBaseEntity9SetParentEPS_i
[[set_parent]]
offset_linux = 40
Expand Down
6 changes: 6 additions & 0 deletions addons/source-python/data/source-python/entities/gmod/CBaseEntity.ini
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[virtual_function]

# _ZN11CBaseEntity8SetModelEPKc
[[set_model]]
offset_linux = 25
offset_windows = 24
arguments = STRING

# _ZN11CBaseEntity9SetParentEPS_i
[[set_parent]]
offset_linux = 35
Expand Down
6 changes: 6 additions & 0 deletions addons/source-python/data/source-python/entities/l4d2/CBaseEntity.ini
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[virtual_function]

# _ZN11CBaseEntity8SetModelEPKc
[[set_model]]
offset_linux = 28
offset_windows = 27
arguments = STRING

# _ZN11CBaseEntity9SetParentEPS_i
[[set_parent]]
offset_linux = 38
Expand Down
6 changes: 6 additions & 0 deletions addons/source-python/data/source-python/entities/orangebox/CBaseEntity.ini
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[virtual_function]

# _ZN11CBaseEntity8SetModelEPKc
[[set_model]]
offset_linux = 25
offset_windows = 24
arguments = STRING

# _ZN11CBaseEntity9SetParentEPS_i
[[set_parent]]
offset_linux = 35
Expand Down
14 changes: 9 additions & 5 deletions addons/source-python/packages/source-python/entities/_base.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -425,17 +425,21 @@ def get_model(self):

return Model(model_name)

@wrap_entity_mem_func
def set_model(self, model):
"""Set the entity's model to the given model.

:param Model model:
The model to set.
:param str/Model model:
The model path or model to set.
"""
self.model_index = model.index
self.model_name = model.path
if isinstance(model, Model):
model = model.path

return [model]

model = property(
get_model, set_model,
get_model,
lambda self, model: self.set_model(model),
doc="""Property to get/set the entity's model.

.. seealso:: :meth:`get_model` and :meth:`set_model`""")
Expand Down