Skip to content

Commit dfd325d

Browse files
author
L'In20Cible
committed
Updated datamap_c...
Fixed compilation issues on Linux. Fixed TypeDescription.input returning a Pointer of the address 0 if the given field is not an input/function.
1 parent 16f6d04 commit dfd325d

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/core/modules/datamap/csgo/datamap_wrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//-----------------------------------------------------------------------------
3737
// typedescription_t extension class.
3838
//-----------------------------------------------------------------------------
39-
class TypeDescExt
39+
class TypeDescriptionExt
4040
{
4141
public:
4242
static int get_flat_offset(typedescription_t pTypeDesc)

src/core/modules/datamap/csgo/datamap_wrap_python.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ template<class T>
5353
void export_engine_specific_type_description(T TypeDescription)
5454
{
5555
TypeDescription.def_readonly("offset", &typedescription_t::fieldOffset);
56-
TypeDescription.add_property("flat_offset", &TypeDescExt::get_flat_offset);
57-
TypeDescription.add_property("packed_offset", &TypeDescExt::get_packed_offset);
56+
TypeDescription.add_property("flat_offset", &TypeDescriptionExt::get_flat_offset);
57+
TypeDescription.add_property("packed_offset", &TypeDescriptionExt::get_packed_offset);
5858
TypeDescription.def_readonly("flat_group", &typedescription_t::flatGroup);
5959
}
6060

src/core/modules/datamap/datamap_wrap.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
//-----------------------------------------------------------------------------
3333
#include "modules/memory/memory_tools.h"
3434
#include "edict.h"
35+
#include "isaverestore.h"
3536
#include "datamap.h"
3637
#include "game/server/variant_t.h"
3738
#include "Color.h"
@@ -108,8 +109,12 @@ class TypeDescriptionSharedExt
108109

109110
static CPointer *get_input(typedescription_t pTypeDesc)
110111
{
111-
// HACK!
112-
return new CPointer((unsigned long)(void *&)pTypeDesc.inputFunc, false);
112+
if (pTypeDesc.flags & FTYPEDESC_INPUT || pTypeDesc.flags & FTYPEDESC_FUNCTIONTABLE)
113+
{
114+
// HACK!
115+
return new CPointer((unsigned long)(void *&)pTypeDesc.inputFunc, false);
116+
}
117+
return NULL;
113118
}
114119
};
115120

src/core/modules/datamap/datamap_wrap_python.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ void export_field_types()
245245
//-----------------------------------------------------------------------------
246246
void export_type_description_flags()
247247
{
248-
249248
enum_<TypeDescriptionSharedExt::Flags> TypeDescriptionFlags("TypeDescriptionFlags");
250249

251250
// Values...

0 commit comments

Comments
 (0)