FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed some issues introduced by last commits. · ericentin/Source.Python@fd6b273 · GitHub

Repository navigation

Commit fd6b273

Browse files
L'In20Cible
committed
Fixed some issues introduced by last commits.
Moved some attributes from Entity to BaseEntity.
1 parent 053c4b1 commit fd6b273

7 files changed

Lines changed: 11 additions & 35 deletions

File tree

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

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ def __new__(cls, index):
6363
# Initialize the object
6464
super(Entity, self).__init__(index)
6565

66-
# Set the entity's base attributes
67-
self._index = index
68-
self._edict = edict
69-
self._pointer = pointer_from_edict(edict)
70-
7166
# Return the instance
7267
return self
7368

@@ -179,37 +174,12 @@ def _obj(cls, ptr):
179174
"""Return an entity instance of the given pointer."""
180175
return cls(index_from_pointer(ptr))
181176

182-
@property
183-
def index(self):
184-
"""Return the entity's index."""
185-
return self._index
186-
187-
@property
188-
def edict(self):
189-
"""Return the entity's edict instance."""
190-
return self._edict
191-
192-
@property
193-
def pointer(self):
194-
"""Return the entity's pointer."""
195-
return self._pointer
196-
197177
@property
198178
def instances(self):
199179
"""Yield the entity's base instances."""
200180
yield self.edict
201181
yield self.pointer
202182

203-
@property
204-
def basehandle(self):
205-
"""Return the entity's BaseEntityHandle instance."""
206-
return self.edict.networkable.get_entity_handle().get_ref_ehandle()
207-
208-
@property
209-
def inthandle(self):
210-
"""Return the entity's integer handle."""
211-
return self.basehandle.to_int()
212-
213183
@property
214184
def classname(self):
215185
"""Return the classname of the entity."""

‎src/core/modules/entities/csgo/entities_constants_wrap.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// Includes.
3232
//-----------------------------------------------------------------------------
3333
#include "utilities/wrap_macros.h"
34-
#include "entities_constants_wrap.h"
34+
#include "entities_constants.h"
3535

3636

3737
//-----------------------------------------------------------------------------

‎src/core/modules/entities/csgo/entities_datamaps_wrap.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// Includes.
3232
//-----------------------------------------------------------------------------
3333
// #include "game/shared/predictioncopy.h"
34-
#include "entities_datamaps_wrap.h"
34+
#include "entities_datamaps.h"
3535

3636

3737
//-----------------------------------------------------------------------------

‎src/core/modules/entities/csgo/entities_props_wrap.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
//-----------------------------------------------------------------------------
3333
#include "dt_common.h"
3434
#include "dt_send.h"
35-
#include "entities_props_wrap.h"
35+
#include "entities_props.h"
3636

3737

3838
//-----------------------------------------------------------------------------

‎src/core/modules/entities/csgo/entities_wrap.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//-----------------------------------------------------------------------------
3131
// Includes.
3232
//-----------------------------------------------------------------------------
33-
#include "entities_wrap.h"
33+
#include "entities.h"
3434

3535

3636
//-----------------------------------------------------------------------------

‎src/core/modules/entities/entities_entity_wrap.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ void export_base_entity(scope _entity)
8181
"The DataMap instance of this entity (read-only)."
8282
);
8383

84+
BaseEntity.add_property("edict", make_function(&EdictFromBaseEntity, reference_existing_object_policy()));
85+
BaseEntity.add_property("index", &IndexFromBaseEntity);
86+
BaseEntity.add_property("pointer", make_function(&PointerFromBaseEntity, manage_new_object_policy()));
87+
BaseEntity.add_property("basehandle", &BaseHandleFromBaseEntity);
88+
BaseEntity.add_property("inthandle", &IntHandleFromBaseEntity);
89+
8490
// Methods...
8591
BaseEntity.def("get_key_value_string",
8692
&CBaseEntityWrapper::GetKeyValueString,

‎src/core/sp_python.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "eiface.h"
3737
#include "utilities/shared_utils.h"
3838
#include "export_main.h"
39-
#include "modules/entities/entities_entity_wrap.h"
39+
#include "modules/entities/entities_entity.h"
4040
#include "icommandline.h"
4141

4242
BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(CBaseEntity)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL