Esempio n. 1
0
  public static void SP_trigger_multiple(Entity ent) {
    if (ent.sounds == 1) ent.noise_index = ServerInit.SV_SoundIndex("misc/secret.wav");
    else if (ent.sounds == 2) ent.noise_index = ServerInit.SV_SoundIndex("misc/talk.wav");
    else if (ent.sounds == 3) ent.noise_index = ServerInit.SV_SoundIndex("misc/trigger1.wav");

    if (ent.wait == 0) ent.wait = 0.2f;

    ent.touch = Touch_Multi;
    ent.movetype = Constants.MOVETYPE_NONE;
    ent.svflags |= Constants.SVF_NOCLIENT;

    if ((ent.spawnflags & 4) != 0) {
      ent.solid = Constants.SOLID_NOT;
      ent.use = trigger_enable;
    } else {
      ent.solid = Constants.SOLID_TRIGGER;
      ent.use = Use_Multi;
    }

    if (!Math3D.VectorEquals(ent.s.angles, Globals.vec3_origin))
      GameBase.G_SetMovedir(ent.s.angles, ent.movedir);

    ServerGame.PF_setmodel(ent, ent.model);
    World.SV_LinkEdict(ent);
  }
Esempio n. 2
0
  public static void InitTrigger(Entity self) {
    if (!Math3D.VectorEquals(self.s.angles, Globals.vec3_origin))
      GameBase.G_SetMovedir(self.s.angles, self.movedir);

    self.solid = Constants.SOLID_TRIGGER;
    self.movetype = Constants.MOVETYPE_NONE;
    ServerGame.PF_setmodel(self, self.model);
    self.svflags = Constants.SVF_NOCLIENT;
  }