SafeTeleportTo(player, distance), on ground, and turn to face target player

I also wrapped TeleportPlayerToWorld with try/catch( nullref ) because netPlayer is a uLink type and might not be there when referenced, because of internet, truth detector, kicks, etc.

This could use some testing on a server that has more than one player.
LGTM. Although it would be cleaner to use `float distance = 1.5f` instead
of the attribute.


On 31 July 2014 16:11, Michael Crews <notifications@github.com> wrote:

> In Fougerite/Fougerite/Player.cs:
>
> > @@ -175,19 +175,46 @@ public void SendCommand(string cmd)
> >              ConsoleNetworker.SendClientCommand(this.PlayerClient.netPlayer, cmd);
> >          }
> >
> > -        public void TeleportTo(Vector3 vector3)
> > +        public void SafeTeleportTo(Fougerite.
> Player p, [Optional, DefaultParameterValue(1.5f)] float distance)
> > +        {
> > +            Vector3 target;
> > +            if (this.Admin) {
> > +                target = p.PlayerClient.controllable.transform.TransformPoint(new Vector3(0, 0, -distance)); // rcon admin teleports behind target player
>
> Sure. Looks clean. Thanks.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/fougerite/Fougerite/pull/43/files#r15663012>.
>



-- 
Alexander Konovalov
email: alex.knvl@gmail.com
skype: alex.knvl
icq: 431935323