-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
Entity's MemberFunction has been broken by 89b5b3f.
getattr(cls, attr) is returning a normal Function. 89b5b3f#diff-068a04bf1a220c8ceac82a8004a4a3bad1ce1c29075df9b5c57bb5d8db3b1cdcR340
Reference:
Source.Python/addons/source-python/packages/source-python/memory/manager.py
Lines 664 to 668 in 35d34c8
| # Called with a this pointer? | |
| if obj is not None: | |
| # Wrap the function using MemberFunction, so we don't have | |
| # to pass the this pointer anymore | |
| func = MemberFunction(self, return_type, func, obj) |
Code:
from players.entity import Player
print(Player(1)._spawn)
print(type(Player(1)._spawn))
Player(1)._spawn()Output:
<_memory.Function object at 0xeb05f700>
<class '_memory.Function'>
[SP] Caught an Exception:
Traceback (most recent call last):
File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin
plugin = self.manager.load(plugin_name)
File "../addons/source-python/packages/source-python/plugins/manager.py", line 207, in load
plugin._load()
File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
self.module = import_module(self.import_name)
File "../addons/source-python/plugins/test/test.py", line 4, in <module>
Player(1)._spawn()
ValueError: Number of passed arguments is not equal to the required number.
jordanbriere
Metadata
Metadata
Assignees
Labels
No labels