MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ParseEventCall

Method ParseEventCall

neo/d3xp/script/Script_Compiler.cpp:1135–1155  ·  view source on GitHub ↗

============ idCompiler::ParseEventCall ============ */

Source from the content-addressed store, hash-verified

1133============
1134*/
1135idVarDef *idCompiler::ParseEventCall( idVarDef *object, idVarDef *funcDef ) {
1136 if ( callthread ) {
1137 Error( "Cannot call built-in functions as a thread" );
1138 }
1139
1140 if ( funcDef->Type() != ev_function ) {
1141 Error( "'%s' is not a function", funcDef->Name() );
1142 }
1143
1144 if ( !funcDef->value.functionPtr->eventdef ) {
1145 Error( "\"%s\" cannot be called with object notation", funcDef->Name() );
1146 }
1147
1148 if ( object->Type() == ev_object ) {
1149 EmitPush( object, &type_entity );
1150 } else {
1151 EmitPush( object, object->TypeDef() );
1152 }
1153
1154 return EmitFunctionParms( OP_EVENTCALL, funcDef, 0, type_object.Size(), NULL );
1155}
1156
1157/*
1158============

Callers

nothing calls this directly

Calls 5

ErrorFunction · 0.50
TypeMethod · 0.45
NameMethod · 0.45
TypeDefMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected