File tree 4 files changed +41
-1
lines changed
addons/source-python/packages/source-python
src/core/modules/entities 4 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 34
34
from messages import HudDestination
35
35
36
36
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
+
37
59
# =============================================================================
38
60
# >> CONSTANTS
39
61
# =============================================================================
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ def get_model(self):
289
289
def set_model (self , model ):
290
290
"""Set the entity's model to the given model."""
291
291
self .model_index = model .index
292
- self .set_key_value_string ( 'model' , model .path )
292
+ self .model_name = model .path
293
293
294
294
model = property (
295
295
get_model , set_model ,
Original file line number Diff line number Diff line change 43
43
#include " entities_entity.h"
44
44
45
45
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
+
46
63
// -----------------------------------------------------------------------------
47
64
// CTakeDamageInfo wrapper class.
48
65
// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ void export_server_entity(scope _entities)
206
206
207
207
.add_property (" model_name" ,
208
208
&IServerEntity::GetModelName,
209
+ &ServerEntityExt::SetModelName,
209
210
" Returns the name of the model this entity is using."
210
211
)
211
212
You can’t perform that action at this time.
0 commit comments