MCPcopy Create free account
hub / github.com/Tencent/UnLua / RestoreOverrides

Method RestoreOverrides

Plugins/UnLua/Source/UnLua/Private/LuaFunction.cpp:134–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void ULuaFunction::RestoreOverrides(UClass* Class)
135{
136 auto OrphanedClass = MakeOrphanedClass(Class);
137 auto Current = &Class->Children;
138 while (*Current)
139 {
140 auto LuaFunction = Cast<ULuaFunction>(*Current);
141 if (!LuaFunction)
142 {
143 Current = &(*Current)->Next;
144 continue;
145 }
146
147 *Current = LuaFunction->Next;
148 const auto Overridden = LuaFunction->GetOverridden();
149 if (Overridden && Overridden->GetOuter() == Class)
150 {
151 check(Overridden->GetName().EndsWith(OverriddenSuffix.Get()));
152 Class->RemoveFunctionFromFunctionMap(Overridden);
153 LuaFunction->Rename(nullptr, OrphanedClass, RenameFlags);
154 FLinkerLoad::InvalidateExport(LuaFunction);
155 Overridden->Rename(*Overridden->GetName().LeftChop(OverriddenSuffix.Length()), nullptr, RenameFlags);
156 Class->AddFunctionToFunctionMap(Overridden, Overridden->GetFName());
157 }
158 else
159 {
160 Class->RemoveFunctionFromFunctionMap(LuaFunction);
161 }
162 }
163 Class->ClearFunctionMapsCaches();
164}
165
166void ULuaFunction::SuspendOverrides(UClass* Class)
167{

Callers

nothing calls this directly

Calls 6

MakeOrphanedClassFunction · 0.85
checkFunction · 0.85
GetOverriddenMethod · 0.80
GetNameMethod · 0.45
GetMethod · 0.45
LengthMethod · 0.45

Tested by

no test coverage detected