Dota2Patcher
 
Loading...
Searching...
No Matches
CEntityIdentity.h
Go to the documentation of this file.
1#pragma once
2#include "../Utils/Memory.h"
3#include "CGameEntitySystem.h"
4#include "CHandle.h"
5
6// Forward declaration
7class CBaseEntity;
9//
10
12public:
14 return Memory::read_memory<CBaseEntity*>(this).value_or(nullptr);
15 }
16
17 bool is_hero() const {
18 const auto name = this->internal_name();
19 return strstr(name.value_or("").c_str(), "npc_dota_hero_");
20 }
21
23 return Memory::read_memory<CSchemaClassBinding*>(this + 0x8).value_or(nullptr);
24 }
25
26 optional <CHandle> handle() const {
27 return Memory::read_memory<CHandle>(this + 0x10);
28 }
29
30 optional<string> internal_name() const { // npc_dota_hero_antimage
31 const auto name_ptr = Memory::read_memory<uintptr_t>(this + 0x18);
32 return !name_ptr ? nullopt : Memory::read_string(name_ptr.value());
33 }
34
35 optional<string> entity_name() const { // npc_dota_hero_antimage
36 const auto name_ptr = Memory::read_memory<uintptr_t>(this + 0x20);
37 return !name_ptr ? nullopt : Memory::read_string(name_ptr.value());
38 }
39
40 optional<CEntityIdentity*> m_pPrev() const {
41 return Memory::read_memory<CEntityIdentity*>(this + 0x58);
42 }
43
44 optional<CEntityIdentity*> m_pNext() const {
45 return Memory::read_memory<CEntityIdentity*>(this + 0x60);
46 }
47};
Definition CBaseEntity.h:6
Definition CEntityIdentity.h:11
optional< string > internal_name() const
Definition CEntityIdentity.h:30
optional< CEntityIdentity * > m_pNext() const
Definition CEntityIdentity.h:44
optional< CEntityIdentity * > m_pPrev() const
Definition CEntityIdentity.h:40
CBaseEntity * base_entity() const
Definition CEntityIdentity.h:13
CSchemaClassBinding * schema_class_binding() const
Definition CEntityIdentity.h:22
optional< string > entity_name() const
Definition CEntityIdentity.h:35
optional< CHandle > handle() const
Definition CEntityIdentity.h:26
bool is_hero() const
Definition CEntityIdentity.h:17
Definition CGameEntitySystem.h:18
static optional< T > read_memory(const N &address)
Definition Memory.h:78
static optional< string > read_string(const T &address, const size_t max_length=64)
Definition Memory.h:125