MCPcopy Create free account
hub / github.com/demoth/jake2 / G_Find

Method G_Find

game/src/main/java/jake2/game/GameBase.java:79–101  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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,

Callers 15

BeginIntermissionMethod · 0.95
G_FindEdictMethod · 0.95
G_PickTargetMethod · 0.95
thinkMethod · 0.95
monster_start_goMethod · 0.95
useMethod · 0.95
touchMethod · 0.95
SelectCoopSpawnPointMethod · 0.95
SelectSpawnPointMethod · 0.95
G_UseTargetsMethod · 0.95

Calls 2

matchesMethod · 0.80
dprintfMethod · 0.65

Tested by

no test coverage detected