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

Method FindFreeResultDef

neo/game/script/Script_Program.cpp:1475–1495  ·  view source on GitHub ↗

============ idProgram::FindFreeResultDef ============ */

Source from the content-addressed store, hash-verified

1473============
1474*/
1475idVarDef *idProgram::FindFreeResultDef( idTypeDef *type, const char *name, idVarDef *scope, const idVarDef *a, const idVarDef *b ) {
1476 idVarDef *def;
1477
1478 for( def = GetDefList( name ); def != NULL; def = def->Next() ) {
1479 if ( def == a || def == b ) {
1480 continue;
1481 }
1482 if ( def->TypeDef() != type ) {
1483 continue;
1484 }
1485 if ( def->scope != scope ) {
1486 continue;
1487 }
1488 if ( def->numUsers <= 1 ) {
1489 continue;
1490 }
1491 return def;
1492 }
1493
1494 return AllocDef( type, name, scope, false );
1495}
1496
1497/*
1498================

Callers 2

EmitOpcodeMethod · 0.45
EmitFunctionParmsMethod · 0.45

Calls 2

NextMethod · 0.45
TypeDefMethod · 0.45

Tested by

no test coverage detected