File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/plugins/core/scripting Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,20 @@ PluginCHandle::PluginCHandle(void* ptr)
77
88PluginCHandle::PluginCHandle (std::string ptr)
99{
10+ if (!starts_with (ptr, " 0x" )) return ;
11+
1012 m_Handle = (CHandle<CEntityInstance>*)strtol (ptr.c_str (), nullptr , 16 );
1113}
1214
1315std::string PluginCHandle::GetPtr ()
1416{
15- return string_format (" %p" , (void *)m_Handle->Get ());
17+ return string_format (" %p" , (void *)m_Handle->Get ());
1618}
1719
1820void PluginCHandle::SetPtr (std::string ptr)
1921{
22+ if (!starts_with (ptr, " 0x" )) return ;
23+
2024 m_Handle->Set ((CEntityInstance*)strtol (ptr.c_str (), nullptr , 16 ));
2125}
2226
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ void PluginMemory::LoadFromPtr(void* ptr)
1616}
1717void PluginMemory::LoadFromAddress (std::string addr)
1818{
19+ if (!starts_with (addr, " 0x" )) return ;
20+
1921 m_ptr = (void *)(strtol (addr.c_str (), nullptr , 16 ));
2022}
2123
You can’t perform that action at this time.
0 commit comments