예제 #1
0
  /**
   * Searches all active entities for the next one that holds the matching string at fieldofs (use
   * the FOFS() macro) in the structure.
   *
   * <p>Searches beginning at the edict after from, or the beginning if null null will be returned
   * if the end of the list is reached.
   */
  public static EntityIterator G_Find(EntityIterator from, EntityFilter eff, String s) {

    if (from == null) from = new EntityIterator(0);
    else from.i++;

    for (; from.i < num_edicts; from.i++) {
      from.o = g_edicts[from.i];
      if (from.o.classname == null) {
        Com.Printf("edict with classname = null" + from.o.index);
      }

      if (!from.o.inuse) continue;

      if (eff.matches(from.o, s)) return from;
    }

    return null;
  }