[comp.sources.bugs] world bugfix

davison@drivax.UUCP (Wayne Davison) (08/12/87)

Here's a minor bugfix to world.  If you've been unable to remove your pants
without specifying their color, this will take care of it.  A quick perusal
of the pants/shirt selection code revealed this minor "if" nesting error in
the de-ambiguity section.


*** helper.c.orig	Tue Jul 28 18:36:03 1987
--- helper.c	Tue Aug 11 17:37:35 1987
***************
*** 578,589 ****
  			result = RPANT;
  		    else
  			result = LPANT;
! 		} else if (wrdnum[0] == DROP)
  		    if (((g1 == 1) || (g1 == 3)) && g2 != 1 && g2 != 3)
  			result = RPANT;
! 		if (((g2 == 1) || (g2 == 3)) && g1 != 1 && g1 != 3)
! 		    result = LPANT;
! 		else
  		    result = -1;
  	    } else if (don == SHIRT) {
  		itsher(RSHIRT, &g1);

--- 578,589 ----
  			result = RPANT;
  		    else
  			result = LPANT;
! 		} else if (wrdnum[0] == DROP) {
  		    if (((g1 == 1) || (g1 == 3)) && g2 != 1 && g2 != 3)
  			result = RPANT;
! 		    if (((g2 == 1) || (g2 == 3)) && g1 != 1 && g1 != 3)
! 			result = LPANT;
! 		} else
  		    result = -1;
  	    } else if (don == SHIRT) {
  		itsher(RSHIRT, &g1);

--
 Wayne Davison					      ...amdahl!drivax!davison
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	   Ziol soft ol of egrt.  Stz'l ltt oy ngx eqf rteohitk oz.
	       Oy ngx rg, hstqlt rkgh dt q fgzt zg stz dt afgv.