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

Method MapGetEntitiesMatchingClassWithString

neo/game/GameEdit.cpp:1106–1129  ·  view source on GitHub ↗

================ idGameEdit::MapGetEntitiesMatchignClassWithString ================ */

Source from the content-addressed store, hash-verified

1104================
1105*/
1106int idGameEdit::MapGetEntitiesMatchingClassWithString( const char *classname, const char *match, const char *list[], const int max ) const {
1107 idMapFile *mapFile = gameLocal.GetLevelMap();
1108 int count = 0;
1109 if ( mapFile ) {
1110 int entCount = mapFile->GetNumEntities();
1111 for ( int i = 0 ; i < entCount; i++ ) {
1112 idMapEntity *ent = mapFile->GetEntity(i);
1113 if (ent) {
1114 idStr work = ent->epairs.GetString("classname");
1115 if ( work.Icmp( classname ) == 0 ) {
1116 if ( match && *match ) {
1117 work = ent->epairs.GetString( "soundgroup" );
1118 if ( count < max && work.Icmp( match ) == 0 ) {
1119 list[count++] = ent->epairs.GetString( "name" );
1120 }
1121 } else if ( count < max ) {
1122 list[count++] = ent->epairs.GetString( "name" );
1123 }
1124 }
1125 }
1126 }
1127 }
1128 return count;
1129}
1130
1131
1132/*

Callers 4

AddInUseSoundsMethod · 0.45
AddSpeakersMethod · 0.45

Calls 5

GetNumEntitiesMethod · 0.80
IcmpMethod · 0.60
GetLevelMapMethod · 0.45
GetEntityMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected