@@ -66,55 +66,52 @@ std::string DumpBuiltinValue(void* value, CSchemaType_Builtin* pType)
6666
6767void DumpAtomicBasicValue (void * value, CSchemaType_Atomic* pType, const char * fieldName)
6868{
69- if (!pType->m_pAtomicInfo )
70- return ImGui::Text (" ? (Atomic null info)" );
71-
72- if (!strcmp (pType->m_pAtomicInfo ->m_pszName , " Vector" ))
69+ if (!strcmp (pType->m_sTypeName , " Vector" ))
7370 {
7471 auto & vector = *static_cast <Vector*>(value);
7572 ImGui::Text (" %f %f %f" , vector.x , vector.y , vector.z );
7673 return ;
7774 }
7875
79- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " Vector2D" ))
76+ if (!strcmp (pType->m_sTypeName , " Vector2D" ))
8077 {
8178 auto & vector = *static_cast <Vector2D*>(value);
8279 ImGui::Text (" %f %f" , vector.x , vector.y );
8380 return ;
8481 }
8582
86- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " QAngle" ))
83+ if (!strcmp (pType->m_sTypeName , " QAngle" ))
8784 {
8885 auto & qangle = *static_cast <QAngle*>(value);
8986 ImGui::Text (" %f %f %f" , qangle.x , qangle.y , qangle.z );
9087 return ;
9188 }
9289
93- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " Color" ))
90+ if (!strcmp (pType->m_sTypeName , " Color" ))
9491 {
9592 auto & color = *static_cast <Color*>(value);
9693 auto imColor = ImVec4 (color.r () / 255 .0f , color.g () / 255 .0f , color.b () / 255 .0f , color.a () / 255 .0f );
9794 ImGui::ColorEdit4 (" color" , (float *)&imColor, ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_InputRGB);
9895 return ;
9996 }
10097
101- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " CUtlSymbolLarge" ))
98+ if (!strcmp (pType->m_sTypeName , " CUtlSymbolLarge" ))
10299 {
103100 auto & symbolLarge = *static_cast <CUtlSymbolLarge*>(value);
104101 ImGui::Text (" \" %s\" " , symbolLarge.String ());
105102
106103 return ;
107104 }
108105
109- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " CUtlString" ))
106+ if (!strcmp (pType->m_sTypeName , " CUtlString" ))
110107 {
111108 auto & string = *static_cast <CUtlString*>(value);
112109 ImGui::Text (" \" %s\" " , string.Get ());
113110
114111 return ;
115112 }
116113
117- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " CEntityIndex" ))
114+ if (!strcmp (pType->m_sTypeName , " CEntityIndex" ))
118115 {
119116 auto & index = *static_cast <CEntityIndex*>(value);
120117 auto entity = GameEntitySystem ()->GetEntityInstance (index);
@@ -129,7 +126,7 @@ void DumpAtomicBasicValue(void* value, CSchemaType_Atomic* pType, const char* fi
129126 return ;
130127 }
131128
132- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " CEntityHandle" ))
129+ if (!strcmp (pType->m_sTypeName , " CEntityHandle" ))
133130 {
134131 auto & handle = *static_cast <CEntityHandle*>(value);
135132 if (auto entity = handle.Get ())
@@ -143,13 +140,13 @@ void DumpAtomicBasicValue(void* value, CSchemaType_Atomic* pType, const char* fi
143140 return ;
144141 }
145142
146- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " CNetworkedQuantizedFloat" ))
143+ if (!strcmp (pType->m_sTypeName , " CNetworkedQuantizedFloat" ))
147144 {
148145 ImGui::Text (" %f" , *static_cast <float *>(value));
149146 return ;
150147 }
151148
152- if (!strcmp (pType->m_pAtomicInfo -> m_pszName , " CUtlStringToken" ))
149+ if (!strcmp (pType->m_sTypeName , " CUtlStringToken" ))
153150 {
154151 ImGui::Text (" %u" , static_cast <CUtlStringToken*>(value)->GetHashCode ());
155152 return ;
@@ -160,10 +157,15 @@ void DumpAtomicBasicValue(void* value, CSchemaType_Atomic* pType, const char* fi
160157
161158void DumpAtomicTValue (void * value, CSchemaType_Atomic_T* pType, const char * fieldName)
162159{
163- if (!pType->m_pAtomicInfo )
160+ auto & mapAtomics = g_pSchemaSystem->GlobalTypeScope ()->m_AtomicInfos .m_Map ;
161+ int index = mapAtomics.Find (pType->m_nAtomicID );
162+
163+ if (index == mapAtomics.InvalidIndex ())
164164 return ImGui::Text (" ? (AtomicT null info)" );
165165
166- if (!strcmp (pType->m_pAtomicInfo ->m_pszName , " CHandle" ))
166+ SchemaAtomicTypeInfo_t* pAtomicInfo = mapAtomics[index].Get ();
167+
168+ if (!strcmp (pAtomicInfo->m_pszName , " CHandle" ))
167169 {
168170 auto & handle = *static_cast <CEntityHandle*>(value);
169171 if (auto entity = handle.Get ())
0 commit comments