Here is a fix for properly undocking both ejected and ghostbusted
players who may have been docked to a SB, which is one of the main
sources of the dreaded starbase etemp bug.
Bill

Index: ./ntserv/ntscmds.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/ntscmds.c,v
retrieving revision 1.3
diff -u -r1.3 ntscmds.c
--- ./ntserv/ntscmds.c  27 Sep 2005 12:26:37 -0000      1.3
+++ ./ntserv/ntscmds.c  10 Apr 2006 05:39:12 -0000
@@ -299,6 +299,13 @@
   j->p_explode=10;
   j->p_status=PEXPLODE;
   j->p_whodead=me->p_no;
+  /* At this point, docked ships become removed. */
+  if (j->p_flags & PFDOCK)
+  {
+    players[j->p_docked].p_docked--;
+    players[j->p_docked].p_port[j->p_port[0]] = VACANT;
+    j->p_flags &= ~PFDOCK;
+  }
 }
 #endif /* ALLOW_EJECT */

Index: ./ntserv/daemonII.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/ntserv/daemonII.c,v
retrieving revision 1.3
diff -u -r1.3 daemonII.c
--- ./ntserv/daemonII.c 27 Sep 2005 12:26:37 -0000      1.3
+++ ./ntserv/daemonII.c 10 Apr 2006 05:39:12 -0000
@@ -3798,6 +3798,13 @@
             }
         }
     }
+    /* At this point, docked ships become removed. */
+    if (victim->p_flags & PFDOCK)
+    {
+        players[victim->p_docked].p_docked--;
+        players[victim->p_docked].p_port[victim->p_port[0]] = VACANT;
+        victim->p_flags &= ~PFDOCK;
+    }
 }

 static void saveplayer(struct player *victim)