Exemplo n.º 1
0
  /**
   * QUAKED trigger_once (.5 .5 .5) ? x x TRIGGERED Triggers once, then removes itself. You must set
   * the key "target" to the name of another object in the level that has a matching "targetname".
   *
   * <p>If TRIGGERED, this trigger must be triggered before it is live.
   *
   * <p>sounds 1) secret 2) beep beep 3) large switch 4)
   *
   * <p>"message" string to be displayed when triggered
   */
  public static void SP_trigger_once(Entity ent) {
    // make old maps work because I messed up on flag assignments here
    // triggered was on bit 1 when it should have been on bit 4
    if ((ent.spawnflags & 1) != 0) {
      float[] v = {0, 0, 0};

      Math3D.VectorMA(ent.mins, 0.5f, ent.size, v);
      ent.spawnflags &= ~1;
      ent.spawnflags |= 4;
      ServerGame.PF_dprintf(
          "fixed TRIGGERED flag on " + ent.classname + " at " + Lib.vtos(v) + "\n");
    }

    ent.wait = -1;
    SP_trigger_multiple(ent);
  }