File tree Expand file tree Collapse file tree 4 files changed +41
-1
lines changed
addons/source-python/packages/source-python
src/core/modules/entities Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 3434from messages import HudDestination
3535
3636
37+ # =============================================================================
38+ # >> ALL DECLARATION
39+ # =============================================================================
40+ __all__ = ('SUPPORTED_KINDS' ,
41+ 'ArgumentError' ,
42+ 'ArgumentNumberMismatch' ,
43+ 'CommandInfo' ,
44+ 'CommandNode' ,
45+ 'CommandParser' ,
46+ 'filter_str' ,
47+ 'InvalidArgumentValue' ,
48+ 'Node' ,
49+ 'Store' ,
50+ 'SubCommandError' ,
51+ 'SubCommandExpectedError' ,
52+ 'SubCommandNotFound' ,
53+ 'TypedClientCommand' ,
54+ 'TypedSayCommand' ,
55+ 'TypedServerCommand' ,
56+ )
57+
58+
3759# =============================================================================
3860# >> CONSTANTS
3961# =============================================================================
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ def get_model(self):
289289 def set_model (self , model ):
290290 """Set the entity's model to the given model."""
291291 self .model_index = model .index
292- self .set_key_value_string ( 'model' , model .path )
292+ self .model_name = model .path
293293
294294 model = property (
295295 get_model , set_model ,
Original file line number Diff line number Diff line change 4343#include " entities_entity.h"
4444
4545
46+ // -----------------------------------------------------------------------------
47+ // IServerEntity extension class.
48+ // -----------------------------------------------------------------------------
49+ class ServerEntityExt
50+ {
51+ public:
52+ static void SetModelName (IServerEntity *pServerEntity, const char *szModelName)
53+ {
54+ CBaseEntity *pBaseEntity = pServerEntity->GetBaseEntity ();
55+ if (!pBaseEntity)
56+ BOOST_RAISE_EXCEPTION (PyExc_ValueError, " BaseEntity is NULL." );
57+
58+ ((CBaseEntityWrapper *)pBaseEntity)->SetKeyValue (" model" , szModelName);
59+ }
60+ };
61+
62+
4663// -----------------------------------------------------------------------------
4764// CTakeDamageInfo wrapper class.
4865// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ void export_server_entity(scope _entities)
206206
207207 .add_property (" model_name" ,
208208 &IServerEntity::GetModelName,
209+ &ServerEntityExt::SetModelName,
209210 " Returns the name of the model this entity is using."
210211 )
211212
You can’t perform that action at this time.
0 commit comments