Skip to content

Commit 490cb07

Browse files
author
L'In20Cible
committed
2 parents 324c52c + b316bd4 commit 490cb07

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

addons/source-python/packages/source-python/commands/typed.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,28 @@
3434
from 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
# =============================================================================

addons/source-python/packages/source-python/entities/entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

src/core/modules/entities/entities.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@
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
//-----------------------------------------------------------------------------

src/core/modules/entities/entities_wrap.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)