Date: Friday February 2, 2001 @ 2:40 Author: cameron Update of /home/netrek/cvsroot/Vanilla/ntserv In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv7460/ntserv Modified Files: orbit.c Log Message: * ntserv/orbit.c (dock): was returning TRUE for failure to dock, so if a base was in the game orbiting failed to be considered. Moved many of the new checks with messages after the check for proximity. Adjusted code indent. * README.releasing: minor adjustments to procedure. **************************************** Index: Vanilla/ntserv/orbit.c diff -u Vanilla/ntserv/orbit.c:1.5 Vanilla/ntserv/orbit.c:1.6 --- Vanilla/ntserv/orbit.c:1.5 Wed Jan 3 03:15:19 2001 +++ Vanilla/ntserv/orbit.c Fri Feb 2 02:40:44 2001 @@ -76,35 +76,6 @@ u_char dir_from_base; /* - * Can't dock on enemy bases: */ - if (! friendlyPlayer(base)) - { - new_warning(UNDEF, "Docking onto a hostile base is unwise, Captain!"); - de_lock(me); - return TRUE; - } - - /* - * Can't dock if you aren't allowed to */ - if ( me->candock == 0 ) - { - new_warning(UNDEF, - "Starbase %s allows everybody else except us to dock, Captain.", - base->p_name); - de_lock(me); - return TRUE; - } - - /* Disallow SB to SB docking */ - - if (me->p_ship.s_type == STARBASE) - { - new_warning(UNDEF, "Starbases are too big to dock onto other starbases."); - de_lock(me); - return TRUE; - } - - /* * See if I am close enough: */ dx = base->p_x - me->p_x; if ((dx > DOCKDIST) || (dx < -DOCKDIST)) @@ -116,6 +87,31 @@ return FALSE; /* + * Can't dock on enemy bases: */ + if (! friendlyPlayer(base)) { + new_warning(UNDEF, "Docking onto a hostile base is unwise, Captain!"); + de_lock(me); + return FALSE; + } + + /* + * Can't dock if you aren't allowed to */ + if ( me->candock == 0 ) { + new_warning(UNDEF, + "Starbase %s allows everybody else except us to dock, Captain.", + base->p_name); + de_lock(me); + return FALSE; + } + + /* Disallow SB to SB docking */ + if (me->p_ship.s_type == STARBASE) { + new_warning(UNDEF, "Starbases are too big to dock onto other starbases."); + de_lock(me); + return FALSE; + } + + /* * See if the base is allowing docking: */ if (! (base->p_flags & PFDOCKOK)) { if (send_short) @@ -125,7 +121,7 @@ "Starbase %s refusing us docking permission, captain.", base->p_name); de_lock(me); - return TRUE; + return FALSE; } /* @@ -136,7 +132,7 @@ else new_warning(UNDEF, "Starbase %s: Permission to dock denied, all ports currently occupied.", base->p_name); de_lock(me); - return TRUE; + return FALSE; } /* @@ -158,8 +154,7 @@ RETURN_IF_VACANT(base, 1); port_id = 1; } - } - else { + } else { /* Below and to left of base: */ if (base->p_port[2] == VACANT) port_id = 2; @@ -172,8 +167,7 @@ port_id = 0; } } - } - else { + } else { /* We are to the right of the base: */ if (dy > 0) { /* Above and to right of base: */ @@ -187,8 +181,7 @@ RETURN_IF_VACANT(base, 2); port_id = 2; } - } - else { + } else { /* Below and to right of base: */ if (base->p_port[1] == VACANT) port_id = 1; @@ -347,7 +340,7 @@ me->p_speed = me->p_desspeed = 0; me->p_planet = l->pl_no; return; - } + } new_warning(81, "Helmsman: Sensors read no valid targets in range to dock or orbit sir!"); }