public static edict_t PickFirst(edict_t self) { if (!PlayerTrail.trail_active) { return(null); } var marker = PlayerTrail.trail_head; for (var n = PlayerTrail.TRAIL_LENGTH; n > 0; n--) { if (PlayerTrail.trail[marker].timestamp <= self.monsterinfo.trail_time) { marker = PlayerTrail.NEXT(marker); } else { break; } } if (GameUtil.visible(self, PlayerTrail.trail[marker])) { return(PlayerTrail.trail[marker]); } if (GameUtil.visible(self, PlayerTrail.trail[PlayerTrail.PREV(marker)])) { return(PlayerTrail.trail[PlayerTrail.PREV(marker)]); } return(PlayerTrail.trail[marker]); }
public static void Add(float[] spot) { float[] temp = { 0, 0, 0 }; if (!PlayerTrail.trail_active) { return; } Math3D.VectorCopy(spot, PlayerTrail.trail[PlayerTrail.trail_head].s.origin); PlayerTrail.trail[PlayerTrail.trail_head].timestamp = GameBase.level.time; Math3D.VectorSubtract(spot, PlayerTrail.trail[PlayerTrail.PREV(PlayerTrail.trail_head)].s.origin, temp); PlayerTrail.trail[PlayerTrail.trail_head].s.angles[1] = Math3D.vectoyaw(temp); PlayerTrail.trail_head = PlayerTrail.NEXT(PlayerTrail.trail_head); }
public static edict_t LastSpot() { return(PlayerTrail.trail[PlayerTrail.PREV(PlayerTrail.trail_head)]); }