@@ -20,14 +20,14 @@ public class HomePlayer : RocketPlayerComponent
2020 private bool cangohome ;
2121 private Vector3 bedPos ;
2222 private byte bedRot ;
23- private Player p ;
23+ private RocketPlayer p ;
2424
2525 private void Load ( )
2626 {
2727 this . GoingHome = false ;
2828 this . cangohome = false ;
2929 }
30- public void GoHome ( Vector3 bedPos , byte bedRot , Player player )
30+ public void GoHome ( Vector3 bedPos , byte bedRot , RocketPlayer player )
3131 {
3232 this . waitrestricted = HomeCommand . Instance . Configuration . TeleportWait ;
3333 this . movementrestricted = HomeCommand . Instance . Configuration . MovementRestriction ;
@@ -45,14 +45,14 @@ public void GoHome(Vector3 bedPos, byte bedRot, Player player)
4545 }
4646 else
4747 {
48- if ( player . SteamChannel . SteamPlayer . IsAdmin && HomeCommand . Instance . WaitGroups . ContainsKey ( "admin" ) )
48+ if ( player . IsAdmin && HomeCommand . Instance . WaitGroups . ContainsKey ( "admin" ) )
4949 {
5050 HomeCommand . Instance . WaitGroups . TryGetValue ( "admin" , out this . waittime ) ;
5151 }
5252 else
5353 {
5454 // Either not an admin or they don't get special wait restrictions.
55- List < Group > hg = player . GetGroups ( ) ;
55+ List < Group > hg = player . Groups ;
5656 byte [ ] time2 = new byte [ hg . Count ] ;
5757 for ( byte g = 0 ; g < hg . Count ; g ++ )
5858 {
@@ -71,11 +71,11 @@ public void GoHome(Vector3 bedPos, byte bedRot, Player player)
7171 if ( this . movementrestricted )
7272 {
7373 this . LastCalledHomePos = this . transform . position ;
74- RocketChatManager . Say ( player . SteamChannel . SteamPlayer . SteamPlayerID . CSteamID , String . Format ( HomeCommand . Instance . Configuration . FoundBedWaitNoMoveMsg , player . name , this . waittime ) ) ;
74+ RocketChatManager . Say ( player , String . Format ( HomeCommand . Instance . Configuration . FoundBedWaitNoMoveMsg , player . CharacterName , this . waittime ) ) ;
7575 }
7676 else
7777 {
78- RocketChatManager . Say ( player . SteamChannel . SteamPlayer . SteamPlayerID . CSteamID , String . Format ( HomeCommand . Instance . Configuration . FoundBedNowWaitMsg , player . name , this . waittime ) ) ;
78+ RocketChatManager . Say ( player , String . Format ( HomeCommand . Instance . Configuration . FoundBedNowWaitMsg , player . CharacterName , this . waittime ) ) ;
7979 }
8080 }
8181 else
@@ -88,28 +88,28 @@ public void GoHome(Vector3 bedPos, byte bedRot, Player player)
8888 private void DoGoHome ( )
8989 {
9090 if ( ! this . cangohome ) return ;
91- RocketChatManager . Say ( this . p . SteamChannel . SteamPlayer . SteamPlayerID . CSteamID , String . Format ( HomeCommand . Instance . Configuration . TeleportMsg , this . p . SteamChannel . SteamPlayer . SteamPlayerID . CharacterName ) ) ;
92- this . p . sendTeleport ( this . bedPos , this . bedRot ) ;
91+ RocketChatManager . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . TeleportMsg , this . p . CharacterName ) ) ;
92+ this . p . Teleport ( this . bedPos , this . bedRot ) ;
9393 this . cangohome = false ;
9494 this . GoingHome = false ;
9595 }
9696 public void FixedUpdate ( )
9797 {
9898 if ( ! this . GoingHome ) return ;
99- if ( this . p . PlayerLife . Dead )
99+ if ( this . p . Dead )
100100 {
101101 // Abort teleport, they died.
102- RocketChatManager . Say ( this . p . SteamChannel . SteamPlayer . SteamPlayerID . CSteamID , String . Format ( HomeCommand . Instance . Configuration . NoTeleportDiedMsg , this . p . SteamChannel . SteamPlayer . SteamPlayerID . CharacterName ) ) ;
102+ RocketChatManager . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . NoTeleportDiedMsg , this . p . CharacterName ) ) ;
103103 this . GoingHome = false ;
104104 this . cangohome = false ;
105105 return ;
106106 }
107107 if ( this . movementrestricted )
108108 {
109- if ( Vector3 . Distance ( this . p . transform . position , this . LastCalledHomePos ) > 0.1 )
109+ if ( Vector3 . Distance ( this . p . Position , this . LastCalledHomePos ) > 0.1 )
110110 {
111111 // Abort teleport, they moved.
112- RocketChatManager . Say ( this . p . SteamChannel . SteamPlayer . SteamPlayerID . CSteamID , String . Format ( HomeCommand . Instance . Configuration . UnableMoveSinceMoveMsg , this . p . SteamChannel . SteamPlayer . SteamPlayerID . CharacterName ) ) ;
112+ RocketChatManager . Say ( this . p , String . Format ( HomeCommand . Instance . Configuration . UnableMoveSinceMoveMsg , this . p . CharacterName ) ) ;
113113 this . GoingHome = false ;
114114 this . cangohome = false ;
115115 return ;
0 commit comments