Understanding some class attributes?

Please post any questions about developing your plugin here. Please use the search function before posting!
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Understanding some class attributes?

Postby arawra » Fri Sep 27, 2013 11:13 pm

In entites.py (packages/source-python/entities/) there is this code in its __setattr__ method:

Code: Select all

            if self.__class__ != BaseEntity:

                # Get the attribute and set its value               
                getattr(self.__class__, attr).fset(self, value)

                # No need to go further
                return


How come it doesn't use "object.__setattr__(self, attr, value)" ? Its causing me issues when trying to subclass PlayerEntity and when setting the index in my class.
'int' has no attribute 'fset' (or something similar)
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Postby Omega_K2 » Sat Sep 28, 2013 5:12 am

I guess PlayerEntity hasn't really been updated.
Libraries: k2tools
Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)
Plugins (game-specific): None atm

If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Sun Sep 29, 2013 4:51 am

This was working before I updated CS:GO and built Source-Python from source code. Do you have any solutions? I am not that familiar with classing and changing the get/set attributes.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 52 guests