Date:	Wednesday August 14, 2002 @ 23:48
Author:	cameron

Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory swashbuckler.real-time.com:/var/tmp/cvs-serv29572/ntserv

Modified Files:
	ntscmds.c 
Log Message:
password change

****************************************

Index: Vanilla/ntserv/ntscmds.c
diff -u Vanilla/ntserv/ntscmds.c:1.23 Vanilla/ntserv/ntscmds.c:1.24
--- Vanilla/ntserv/ntscmds.c:1.23	Fri Jun 21 02:41:35 2002
+++ Vanilla/ntserv/ntscmds.c	Wed Aug 14 23:48:17 2002
@@ -1,4 +1,4 @@
-/* $Id: ntscmds.c,v 1.23 2002/06/21 07:41:35 cameron Exp $
+/* $Id: ntscmds.c,v 1.24 2002/08/15 04:48:17 cameron Exp $
  */
 
 /*
@@ -1115,11 +1115,18 @@
   char *addr = addr_mess(who,MINDIV);
   char *one, *two;
 
-  /* need code here? if observer skip command */
+  /* guests have no player file position */
+  if (me->p_pos < 0) {
+    pmessage(who, MINDIV, addr, 
+	     "You can't change your password, sorry!");
+    return;
+  }
 
+  /* consume the command */
   one = strtok(comm, " ");
   if (one == NULL) return;
 
+  /* look at the first word after command */
   one = strtok(NULL, " ");
   if (one == NULL) {
     pmessage(who, MINDIV, addr, 
@@ -1127,6 +1134,7 @@
     return;
   }
 
+  /* look at the second word after command */
   two = strtok(NULL, " ");
   if (two == NULL) {
     pmessage(who, MINDIV, addr, 
@@ -1134,14 +1142,19 @@
     return;
   }
 
+  /* compare and reject if different */
   if (strcmp(one, two)) {
     pmessage(who, MINDIV, addr, 
 	     "No way, the two passwords are different!");
     return;
   }
 
+  /* change the password */
+  changepassword(&me->p_stats, one);
+
+  /* tell her we changed it */
   pmessage(who, MINDIV, addr, 
-	   "You want your password to be %s", one);
+	   "Password changed to %s", one);
 }