Exemplo n.º 1
0
        public void OnEntityCollide(Entity entity)
        {
            if (!Repaired)
            {
                return;
            }

            EntityPlayer player = entity as EntityPlayer;

            if (player == null)
            {
                return;
            }

            if (player.IsActivityRunning("teleportCooldown")) //REVIEW ActivityRunning not working?
            {
                return;
            }

            TeleportingPlayer tpe;

            if (!tpingPlayers.TryGetValue(player.PlayerUID, out tpe))
            {
                tpingPlayers[player.PlayerUID] = tpe = new TeleportingPlayer()
                {
                    Player = player,
                    State  = EnumTeleportingEntityState.None
                };
            }

            tpe.LastCollideMs = Api.World.ElapsedMilliseconds;
            Active            = true;
        }