MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / CheckForMemberDefault

Function CheckForMemberDefault

src/scripting/backend/codegen_doom.cpp:263–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261//==========================================================================
262
263FxExpression* CheckForMemberDefault(FxStructMember *func, FCompileContext &ctx)
264{
265 auto& membervar = func->membervar;
266 auto& classx = func->classx;
267 auto& ScriptPosition = func->ScriptPosition;
268
269 if (membervar->SymbolName == NAME_Default)
270 {
271 if (!classx->ValueType->isObjectPointer()
272 || !static_cast<PObjectPointer *>(classx->ValueType)->PointedClass()->IsDescendantOf(RUNTIME_CLASS(AActor)))
273 {
274 ScriptPosition.Message(MSG_ERROR, "'Default' requires an actor type");
275 delete func;
276 return nullptr;
277 }
278 FxExpression * x = new FxClassDefaults(classx, ScriptPosition);
279 classx = nullptr;
280 delete func;
281 return x->Resolve(ctx);
282 }
283 return func;
284}
285
286//==========================================================================
287//

Callers

nothing calls this directly

Calls 5

isObjectPointerMethod · 0.80
IsDescendantOfMethod · 0.80
PointedClassMethod · 0.80
MessageMethod · 0.80
ResolveMethod · 0.45

Tested by

no test coverage detected