============ idCompiler::ParseEventCall ============ */
| 1133 | ============ |
| 1134 | */ |
| 1135 | idVarDef *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 | ============ |