Searches all active entities for the next one that holds the matching string at fieldofs (use the FOFS() macro) in the structure. Searches beginning at the edict after from, or the beginning if null null will be returned if the end of the list is reached. @param name - either className or targetNa
(EdictIterator from, EdictFindFilter eff,
String name, GameExportsImpl gameExports)
| 77 | * @param name - either className or targetName |
| 78 | */ |
| 79 | public static EdictIterator G_Find(EdictIterator from, EdictFindFilter eff, |
| 80 | String name, GameExportsImpl gameExports) { |
| 81 | |
| 82 | if (from == null) |
| 83 | from = new EdictIterator(0); |
| 84 | else |
| 85 | from.i++; |
| 86 | |
| 87 | for (; from.i < gameExports.num_edicts; from.i++) { |
| 88 | from.o = gameExports.g_edicts[from.i]; |
| 89 | if (from.o.classname == null) { |
| 90 | gameExports.gameImports.dprintf("edict with classname = null" + from.o.index); |
| 91 | } |
| 92 | |
| 93 | if (!from.o.inuse) |
| 94 | continue; |
| 95 | |
| 96 | if (eff.matches(from.o, name)) |
| 97 | return from; |
| 98 | } |
| 99 | |
| 100 | return null; |
| 101 | } |
| 102 | |
| 103 | // comfort version (rst) |
| 104 | static edict_t G_FindEdict(EdictIterator from, EdictFindFilter eff, |
no test coverage detected