[comp.sources.games.bugs] conquer v3 - patch number 5

smile@homxc.UUCP (E.BARLOW) (07/28/88)

*** onpc.c	Thu Jul 28 09:10:33 1988
--- npc.c	Thu Jul 28 09:11:10 1988
***************
*** 123,130
  			}
  		}
  	}
! 	else {
! 		/*place a new Nomad army*/
  		x=(rand()%(MAPX-8))+4;
  		y=(rand()%(MAPY-8))+4;
  		if((rand()%4==0)&&(is_habitable(x,y))) {

--- 123,130 -----
  			}
  		}
  	}
! 	/* place a few new Nomad armies */
! 	for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD<=0){
  		x=(rand()%(MAPX-8))+4;
  		y=(rand()%(MAPY-8))+4;
  		if((rand()%4==0)&&(is_habitable(x,y))) {
***************
*** 131,137
  			AXLOC=x;
  			AYLOC=y;
  			ASOLD=100+100*(rand()%10);
! 			ATYPE=A_INFANTRY;
  			ASTAT=ATTACK;
  		}
  	}

--- 131,137 -----
  			AXLOC=x;
  			AYLOC=y;
  			ASOLD=100+100*(rand()%10);
! 			ATYPE=A_LT_CAV;
  			ASTAT=ATTACK;
  		}
  		if(rand()%3==0) break;
***************
*** 134,139
  			ATYPE=A_INFANTRY;
  			ASTAT=ATTACK;
  		}
  	}
  	country=NLIZARD;
  	for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0){

--- 134,140 -----
  			ATYPE=A_LT_CAV;
  			ASTAT=ATTACK;
  		}
+ 		if(rand()%3==0) break;
  	}
  	country=NLIZARD;
  	for(armynum=0;armynum<MAXARM;armynum++) if(ASOLD>0){
***************
*** 615,621
  {
  	int goldthresh,ironthresh,citythresh;
  	int armynum,loop;
! 	int x,y,i;
  	long zz;
  
  #ifdef DEBUG

--- 616,622 -----
  {
  	int goldthresh,ironthresh,citythresh;
  	int armynum,loop;
! 	int x,y,i,p;
  	long zz;
  
  #ifdef DEBUG
***************
*** 730,737
  		if(ntn[country].jewels > getmgkcost(M_MIL,country)) {
  			ntn[country].jewels-=getmgkcost(M_MIL,country);
  			if((zz=getmagic(M_MIL))!=0){
! 				fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
! 				printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  				exenewmgk(zz);
  			} else if((zz=getmagic(M_MIL))!=0){
  				fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz);

--- 731,741 -----
  		if(ntn[country].jewels > getmgkcost(M_MIL,country)) {
  			ntn[country].jewels-=getmgkcost(M_MIL,country);
  			if((zz=getmagic(M_MIL))!=0){
! 				for(p=S_MIL;p<=E_MIL;p++) if(powers[p]==zz){
! 					fprintf(fnews,"1.\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]);
! 					printf("\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]);
! 					break;
! 				}
  				exenewmgk(zz);
  			} else if((zz=getmagic(M_MIL))!=0){
  				for(p=S_MIL;p<=E_MIL;p++) if(powers[p]==zz){
***************
*** 734,741
  				printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  				exenewmgk(zz);
  			} else if((zz=getmagic(M_MIL))!=0){
! 				fprintf(fnews,"1.\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
! 				printf("\tnation %s gets combat power number %ld\n",ntn[country].name,zz);
  				exenewmgk(zz);
  			}
  			else	ntn[country].jewels+=getmgkcost(M_MIL,country);

--- 738,748 -----
  				}
  				exenewmgk(zz);
  			} else if((zz=getmagic(M_MIL))!=0){
! 				for(p=S_MIL;p<=E_MIL;p++) if(powers[p]==zz){
! 					fprintf(fnews,"1.\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]);
! 					printf("\tnation %s gets combat power %s\n",ntn[country].name,pwrname[p]);
! 					break;
! 				}
  				exenewmgk(zz);
  			}
  			else	ntn[country].jewels+=getmgkcost(M_MIL,country);
***************
*** 744,751
  		if(ntn[country].jewels > getmgkcost(M_CIV,country)) {
  			ntn[country].jewels-=getmgkcost(M_CIV,country);
  			if((zz=getmagic(M_CIV))!=0){
! 				fprintf(fnews,"1.\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
! 				printf("\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
  				exenewmgk(zz);
  			}
  			else if((zz=getmagic(M_CIV))!=0){

--- 751,761 -----
  		if(ntn[country].jewels > getmgkcost(M_CIV,country)) {
  			ntn[country].jewels-=getmgkcost(M_CIV,country);
  			if((zz=getmagic(M_CIV))!=0){
! 				for(p=S_CIV;p<=E_CIV;p++) if(powers[p]==zz){
! 					fprintf(fnews,"1.\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[p]);
! 					printf("\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[p]);
! 					break;
! 				}
  				exenewmgk(zz);
  			}
  			else if((zz=getmagic(M_CIV))!=0){
***************
*** 749,756
  				exenewmgk(zz);
  			}
  			else if((zz=getmagic(M_CIV))!=0){
! 				fprintf(fnews,"1.\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
! 				printf("\tnation %s gets civilian power number %ld\n",ntn[country].name,zz);
  				exenewmgk(zz);
  			}
  			else	ntn[country].jewels+=getmgkcost(M_CIV,country);

--- 759,769 -----
  				exenewmgk(zz);
  			}
  			else if((zz=getmagic(M_CIV))!=0){
! 				for(p=S_CIV;p<=E_CIV;p++) if(powers[p]==zz){
! 					fprintf(fnews,"1.\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[zz]);
! 					printf("\tnation %s gets civilian power %s\n",ntn[country].name,pwrname[zz]);
! 					break;
! 				}
  				exenewmgk(zz);
  			}
  			else	ntn[country].jewels+=getmgkcost(M_CIV,country);
*** oheader.h	Thu Jul 28 09:10:33 1988
--- header.h	Thu Jul 28 09:11:11 1988
*** odata.h	Thu Jul 28 09:10:47 1988
--- data.h	Thu Jul 28 09:11:11 1988
***************
*** 426,432
  extern	void see(),showscore(),update(),updmove(),verifydata(),verify_ntn();
  extern	void verify_sct(),wmessage(),writedata(),getdstatus(),exit();
  #ifdef TRADE
! extern	void trade(),uptrade();
  #endif TRADE
  
  extern	char	*crypt(),*strcpy(),*strncpy(),*strcat(),*strncat();

--- 426,432 -----
  extern	void see(),showscore(),update(),updmove(),verifydata(),verify_ntn();
  extern	void verify_sct(),wmessage(),writedata(),getdstatus(),exit();
  #ifdef TRADE
! extern	void trade(),uptrade(),checktrade();
  #endif TRADE
  
  extern	char	*crypt(),*strcpy(),*strncpy(),*strcat(),*strncat();
*** ohelp.txt	Thu Jul 28 09:10:49 1988
--- help.txt	Thu Jul 28 09:11:12 1988
***************
*** 100,107
  	              merging 2 armies, splitting armies, and disbanding armies
  'c': administration: Report on nation status and then change name, password,
  	              add to combat bonus, or (if god) destroy a nation.
! 'd': change display: Change display mode.  Numbers in gold screens... are
! 	              relative values of the materials.
  'f': fleet report:   Report on the status of your fleets.
  'g': group report:   As army report, but display will only show those armies
  	              in the current sector.

--- 100,107 -----
  	              merging 2 armies, splitting armies, and disbanding armies
  'c': administration: Report on nation status and then change name, password,
  	              add to combat bonus, or (if god) destroy a nation.
! 'd': change display: Change display mode.  iron/gold screen #'s are sector 
!                       value.  Population screen #'s are the closest 100 people
  'f': fleet report:   Report on the status of your fleets.
  'g': group report:   As army report, but display will only show those armies
  	              in the current sector.
***************
*** 318,327
  Warship		XSHIPCREW	XWARSHPCOST		XSHIPMAINT		0
  Merchant	XSHIPCREW	XMERSHPCOST		XSHIPMAINT		XSHIPCP
  
! Ships will now have crews - which, in addition to being drafted upon
! construction, represent the ships current level of damage and are replaced,
! in harbor, by using the construct ships command.  Movement of
! a fleet is reduced if the crews are not full.  Marine or Sailor Armies
  can also be carried by navies with warships.  Each fleet may carry one army
  in addition to any troops that are ferried - who dont count in combat.
  Marines add to chances of success in shipboard combat.

--- 318,326 -----
  Warship		XSHIPCREW	XWARSHPCOST		XSHIPMAINT		0
  Merchant	XSHIPCREW	XMERSHPCOST		XSHIPMAINT		XSHIPCP
  
! Ships require crews - which both represent men on board and the current level 
! of damage.  Crew is replaced (repairs) in harbor, via <construct ships>. Fleet 
! movement is reduced if the crews are not full.  Marine or Sailor Armies
  can also be carried by navies with warships.  Each fleet may carry one army
  in addition to any troops that are ferried - who dont count in combat.
  Marines add to chances of success in shipboard combat.
***************
*** 405,411
  NINJA 	   Can have Ninja units.  Spys show enemy troop/civilian strength
  		exactly (even voids)
  SAILOR 	   1/2 price naval units.  Can use marines. +10% ramming.
! DEMOCRACY  +10% in combat (moralle) +1 Move +1 repro All units eat double.
  ROADS 	   +4 to move if unit starts in your nation.
  SLAVER     you gain 25% of the populace of *any* sector you take over
  END

--- 404,410 -----
  NINJA 	   Can have Ninja units.  Spys show enemy troop/civilian strength
  		exactly (even voids)
  SAILOR 	   1/2 price naval units.  Can use marines. +10% ramming.
! DEMOCRACY  +10% in combat (moralle) +1 Move +1 repro All civilians eat double.
  ROADS 	   +4 to move if unit starts in your nation.
  SLAVER     you gain 25% of the populace of *any* sector you take over
  END
***************
*** 499,504
     180-190      0%  0%  0%  0%  5% 10% 10% 20% 20% 30% 30% 30% 30% 40% 40%
     190+++       0%  0%  0%  0%  5% 10% 10% 10% 20% 20% 30% 30% 30% 30% 40%
  END
  	                 FINAL HINTS & OTHER COSTS
  
  It is important to initially have a reprorate of 9-10% and a move of ~8-9.

--- 498,536 -----
     180-190      0%  0%  0%  0%  5% 10% 10% 20% 20% 30% 30% 30% 30% 40% 40%
     190+++       0%  0%  0%  0%  5% 10% 10% 10% 20% 20% 30% 30% 30% 30% 40%
  END
+                          MAIL MESSAGE FROM COMBAT
+ 
+ The following is a mail message you might recieve after a combat.  An
+ explaination of its details follows.
+ 
+ BATTLE SUMMARY for sector 22, 29
+ You are on the Defending Side
+ edland is attacking with army 17 (type Infantry, men 125, bonus=80)
+ edland is attacking with army 23 (type Infantry, men 160, bonus=80)
+ uru is defending with army 9 (type Infantry, men 84, bonus=110)
+ attacking soldiers=285	modified roll=42-> attackers percent loss 30%
+ defending soldiers=84	modified roll=100-> defenders percent loss 70%
+ ODDS are 339 to 100
+ RESULT: Attackers lose 85 men, Defenders lose 49 men
+ Additionally, All defenders retreat to 21 28
+ END
+                               AN EXAMPLE OF COMBAT
+ 
+ A battle occurs in 22,29 (a "good" farm) between your nation "uru" (defender) 
+ and "edland".  They have 285 infantry vs. 84 of your infantry. Your defensive 
+ bonus is +70, their attack bonus is +40. Infantry are +0/+0. A movement bonus 
+ goes to both sides = 5*(9-movecost)=+40.  Their total bonus is 40+40+=+80. 
+ Yours is 70+40=110. This leads to dice modifier of 30 in your favor.
+ They roll 22 which +50-30=42; which on the 3:1 table yields 30% losses
+ you roll 80 which +50-30=100; 200-100 on the 1:3 table yields 70% losses
+ the actual loss is troops * Percent * divisor / (100+plus), where the divisor
+ is the least bonus on any side (better troops die less).  For you this leads
+ to 84*70*1.4 / 100*(1.7) = 49 men. for them it leads to 85 men.  Despite your
+ awful luck at the dice, you still came out quite well.
+ 
+ However, because they did cream you, there was a chance that you were
+      forced to retreat, which you did to 21 28.
+ END
  	                 FINAL HINTS & OTHER COSTS
  
  It is important to initially have a reprorate of 9-10% and a move of ~8-9.
***************
*** 528,533
  If you have too many people in a given non Town, non capitol sector, 
  reproduction and production is halved for them.  If you have a huge 
  (>10,000,000) number of people in a sector, they will not reproduce.
  END
  			OPTIONS OF YOUR VERSION
  

--- 560,568 -----
  If you have too many people in a given non Town, non capitol sector, 
  reproduction and production is halved for them.  If you have a huge 
  (>10,000,000) number of people in a sector, they will not reproduce.
+ 
+ WARNING: The Naval Code has been known to be buggy.  Please pay attention
+ and send the author notes on discrepancies in the code.
  END
  			OPTIONS OF YOUR VERSION
  
*** otrade.c	Thu Jul 28 09:10:15 1988
--- trade.c	Thu Jul 28 09:11:13 1988
***************
*** 42,48
  #define	BUY	1
  #define	NODEAL	2
  #define	NOSALE	3
! #define TRADECOST(cost)	((100-cost)/100)	/* twenty percent cost normal*/
  
  extern short country;
  

--- 42,48 -----
  #define	BUY	1
  #define	NODEAL	2
  #define	NOSALE	3
! #define TRADECOST(cost)	(100-cost)/100	/* twenty percent cost is normal*/
  
  extern short country;
  
***************
*** 54,65
  	"no available armies", "no available navies"};
  #endif ADMIN
  #ifdef CONQUER
! /* Use this when you wish to sell something */
! char *selllist[NUMPRODUCTS] = { "Sell how many gold talons? ", "Sell how much food? ",
! 	"Sell how much iron? ", "Sell how many jewels? ", "What X location? ",
! 	"How many soldiers? ", "How many ships? "};
! 
! /* Use this when you wish to place a bid something */
  char *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ",
  	"Bid how much iron? ", "Bid how many jewels? ", " ",
  	"Bid what army? ", "Bid how many ships? "};

--- 54,60 -----
  	"no available armies", "no available navies"};
  #endif ADMIN
  #ifdef CONQUER
! /* Use this when you wish to bid something */
  char *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ",
  	"Bid how much iron? ", "Bid how many jewels? ", "What X location? ",
  	"Bid what army? ", "Bid what navy? "};
***************
*** 61,68
  
  /* Use this when you wish to place a bid something */
  char *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ",
! 	"Bid how much iron? ", "Bid how many jewels? ", " ",
! 	"Bid what army? ", "Bid how many ships? "};
  
  void
  trade()

--- 56,63 -----
  #ifdef CONQUER
  /* Use this when you wish to bid something */
  char *buylist[NUMPRODUCTS] = { "Bid how much gold? ", "Bid how much food? ",
! 	"Bid how much iron? ", "Bid how many jewels? ", "What X location? ",
! 	"Bid what army? ", "Bid what navy? "};
  
  void
  trade()
***************
*** 121,126
  						holdlong,
  						commodities[type1[holdint]]);
  				}
  				mvprintw(count,40,"%9ld %s",
  					lvar2[holdint],
  					commodities[type2[holdint]]);

--- 116,126 -----
  						holdlong,
  						commodities[type1[holdint]]);
  				}
+ 				if (type2[holdint]==TDLAND) {
+ 					mvprintw(count,40,"(food=%2ld) %s",
+ 						lvar2[holdint],
+ 						commodities[type2[holdint]]);
+ 				} else {
  				mvprintw(count,40,"%9ld %s",
  					lvar2[holdint],
  					commodities[type2[holdint]]);
***************
*** 124,129
  				mvprintw(count,40,"%9ld %s",
  					lvar2[holdint],
  					commodities[type2[holdint]]);
  				if (count>16) {
  					standout();
  					mvaddstr(21,30,"Hit Any Key to Continue");

--- 124,130 -----
  				mvprintw(count,40,"%9ld %s",
  					lvar2[holdint],
  					commodities[type2[holdint]]);
+ 				}
  				if (count>16) {
  					standout();
  					mvaddstr(21,30,"Hit Any Key to Continue");
***************
*** 135,141
  					mvaddstr(0,27,"COMMODITIES EXCHANGE");
  					standend();
  					mvprintw(2,0,"    Nation\t\tItem\t\tMinimum Price");
! 					count=3;
  				}
  			}
  		}

--- 136,142 -----
  					mvaddstr(0,27,"COMMODITIES EXCHANGE");
  					standend();
  					mvprintw(2,0,"    Nation\t\tItem\t\tMinimum Price");
! 					count=2;
  				}
  			}
  		}
***************
*** 141,146
  		}
  		standout();
  		count++;
  		if (itemnum==0)	mvaddstr(count++,0,"Nothing to Buy.  Do you wish to (S)ell?");
  		else mvaddstr(count++,0,"Do you wish to (B)uy, (S)ell, or (U)nsell?");
  		standend();

--- 142,148 -----
  		}
  		standout();
  		count++;
+ 		count++;
  		if (itemnum==0)	mvaddstr(count++,0,"Nothing to Buy.  Do you wish to (S)ell?");
  		else mvaddstr(count++,0,"Do you wish to (B)uy, (S)ell, or (U)nsell?");
  		standend();
***************
*** 217,223
  			case TDLAND:
  				mvaddstr(count++,0,"What Y position? ");
  				refresh();
! 				holdlong2 = (long) get_number;
  				if (checkland(BUY,(int)(holdlong),(int)(holdlong2))==NODEAL) {
  					buysell=NODEAL;
  				} else if (tofood(sct[(int)holdlong][(int)holdlong2].vegetation,natn[holdint]) < lvar2[holdint]) {

--- 219,225 -----
  			case TDLAND:
  				mvaddstr(count++,0,"What Y position? ");
  				refresh();
! 				holdlong2 = (long) get_number();
  				if (checkland(BUY,(int)(holdlong),(int)(holdlong2))==NODEAL) {
  					buysell=NODEAL;
  				} else if (tofood(sct[(int)holdlong][(int)holdlong2].vegetation,natn[holdint]) < lvar2[holdint]) {
***************
*** 256,262
  					tradeerr("Error opening file for trading");
  					abrt();
  				}
! 				setaside(country,type2[holdint],holdlong);
  				fprintf(tfile, "%d %d %d %d %ld %ld %d\n",BUY, country, holdint, 0, holdlong, holdlong2, 0);
  				fclose(tfile);
  			}

--- 258,264 -----
  					tradeerr("Error opening file for trading");
  					abrt();
  				}
! 				setaside(country,type2[holdint],holdlong,(int)holdlong,FALSE);
  				fprintf(tfile, "%d %d %d %d %ld %ld %d\n",BUY, country, holdint, 0, holdlong, holdlong2, 0);
  				fclose(tfile);
  			}
***************
*** 280,286
  				return;
  			}
  
! 			mvprintw(count++,0,"%s",selllist[holdint]);
  			refresh();
  			/* find out how much commodities */
  			holdlong = (long) get_number();

--- 282,288 -----
  				return;
  			}
  
! 			mvprintw(count++,0,"%s",buylist[holdint]);
  			refresh();
  			/* find out how much commodities */
  			holdlong = (long) get_number();
***************
*** 357,363
  				}
  			} else {
  				/* find out for what value */
! 				mvprintw(count++,0,"Minimum %s",selllist[holdint2]);
  				refresh();
  				holdlong2 = (long) get_number();
  				if (holdlong2 == 0L) return;

--- 359,366 -----
  				}
  			} else {
  				/* find out for what value */
! 				mvprintw(count++,0,"Minimum Amount of %s? "
! 					,commodities[holdint2]);
  				refresh();
  				holdlong2 = (long) get_number();
  				if (holdlong2 == 0L) return;
***************
*** 364,370
  			}
  
  			/* make sure what was bid is unusable */
! 			setaside(country,holdint,holdlong);
  
  			/* set up output properly */
  			if (holdint==TDARMY) {

--- 367,373 -----
  			}
  
  			/* make sure what was bid is unusable */
! 			setaside(country,holdint,holdlong,(int)holdlong,FALSE);
  
  			/* set up output properly */
  			if (holdint==TDARMY) {
***************
*** 416,422
  			}
  			fprintf(tfile, "%d %d %d %d %ld %ld %d\n", NOSALE, natn[holdint], holdint, 0, 0L, 0L, 0);
  			fclose(tfile);
! 			takeback(natn[holdint],type1[holdint],lvar1[holdint]);
  			/*redraw the commodities board so removal is seen*/
  			inloop=FALSE;
  			done=FALSE;

--- 419,425 -----
  			}
  			fprintf(tfile, "%d %d %d %d %ld %ld %d\n", NOSALE, natn[holdint], holdint, 0, 0L, 0L, 0);
  			fclose(tfile);
! 			takeback(natn[holdint],type1[holdint],lvar1[holdint],extra[holdint],FALSE);
  			/*redraw the commodities board so removal is seen*/
  			inloop=FALSE;
  			done=FALSE;
***************
*** 486,492
  		&&entered!=WOOD   &&entered!=FOREST
  		&&entered!=SWAMP  &&entered!=ICE) temp=(-1);
  	else temp = tofood(entered,country);
! 	mvprintw((*count)++,0," JUST ENTERED %c so temp is %d", entered,temp);
  	return(temp);
  }
  

--- 489,495 -----
  		&&entered!=WOOD   &&entered!=FOREST
  		&&entered!=SWAMP  &&entered!=ICE) temp=(-1);
  	else temp = tofood(entered,country);
! 	mvprintw((*count)++,0," JUST ENTERED %c so food value is %d", entered,temp);
  	return(temp);
  }
  
***************
*** 533,538
  	}
  	return(hold);
  }
  
  /* set aside things that are up for bid */
  void

--- 536,542 -----
  	}
  	return(hold);
  }
+ #endif CONQUER
  
  /* set aside things that are up for bid */
  void
***************
*** 536,543
  
  /* set aside things that are up for bid */
  void
! setaside(cntry,item,longval)
! int cntry,item;
  long longval;
  {
  	switch(item)

--- 540,547 -----
  
  /* set aside things that are up for bid */
  void
! setaside(cntry,item,longval,extint,isup)
! int cntry,item,isup,extint;
  long longval;
  {
  	switch(item)
***************
*** 543,549
  	switch(item)
  	{
  	case TDGOLD:
! 		ntn[cntry].tgold -= longval;
  		break;
  	case TDFOOD:
  		ntn[cntry].tfood -= longval;

--- 547,553 -----
  	switch(item)
  	{
  	case TDGOLD:
! 		if (isup==FALSE) ntn[cntry].tgold -= longval;
  		break;
  	case TDFOOD:
  		ntn[cntry].tfood -= longval;
***************
*** 549,555
  		ntn[cntry].tfood -= longval;
  		break;
  	case TDIRON:
! 		ntn[cntry].tiron -= longval;
  		break;
  	case TDJEWL:
  		ntn[cntry].jewels -= longval;

--- 553,559 -----
  		ntn[cntry].tfood -= longval;
  		break;
  	case TDIRON:
! 		if (isup==FALSE) ntn[cntry].tiron -= longval;
  		break;
  	case TDJEWL:
  		if (isup==FALSE) ntn[cntry].jewels -= longval;
***************
*** 552,558
  		ntn[cntry].tiron -= longval;
  		break;
  	case TDJEWL:
! 		ntn[cntry].jewels -= longval;
  		break;
  	case TDLAND:
  		break;

--- 556,562 -----
  		if (isup==FALSE) ntn[cntry].tiron -= longval;
  		break;
  	case TDJEWL:
! 		if (isup==FALSE) ntn[cntry].jewels -= longval;
  		break;
  	case TDLAND:
  		break;
***************
*** 557,564
  	case TDLAND:
  		break;
  	case TDARMY:
! 		ntn[cntry].arm[(int)longval].smove = 0;
! 		ntn[cntry].arm[(int)longval].stat = TRADED;
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */

--- 561,568 -----
  	case TDLAND:
  		break;
  	case TDARMY:
! 		ntn[cntry].arm[extint].smove = 0;
! 		ntn[cntry].arm[extint].stat = TRADED;
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */
***************
*** 562,569
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */
! 		ntn[cntry].nvy[(int)longval].smove = 0;
! 		ntn[cntry].nvy[(int)longval].armynum = TRADED;
  		break;
  	}
  }

--- 566,573 -----
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */
! 		ntn[cntry].nvy[extint].smove = 0;
! 		ntn[cntry].nvy[extint].armynum = TRADED;
  		break;
  	}
  }
***************
*** 570,577
  
  /* regain things that are up for bid */
  void
! takeback(cntry,item,longval)
! int cntry,item;
  long longval;
  {
  	switch(item)

--- 574,581 -----
  
  /* regain things that are up for bid */
  void
! takeback(cntry,item,longval,extint,isup)
! int cntry,item,isup,extint;
  long longval;
  {
  	switch(item)
***************
*** 577,583
  	switch(item)
  	{
  	case TDGOLD:
! 		ntn[cntry].tgold += longval;
  		break;
  	case TDFOOD:
  		ntn[cntry].tfood += longval;

--- 581,587 -----
  	switch(item)
  	{
  	case TDGOLD:
! 		if (isup==FALSE) ntn[cntry].tgold += longval;
  		break;
  	case TDFOOD:
  		ntn[cntry].tfood += longval;
***************
*** 583,589
  		ntn[cntry].tfood += longval;
  		break;
  	case TDIRON:
! 		ntn[cntry].tiron += longval;
  		break;
  	case TDJEWL:
  		ntn[cntry].jewels += longval;

--- 587,593 -----
  		ntn[cntry].tfood += longval;
  		break;
  	case TDIRON:
! 		if (isup==FALSE) ntn[cntry].tiron += longval;
  		break;
  	case TDJEWL:
  		if (isup==FALSE) ntn[cntry].jewels += longval;
***************
*** 586,592
  		ntn[cntry].tiron += longval;
  		break;
  	case TDJEWL:
! 		ntn[cntry].jewels += longval;
  		break;
  	case TDLAND:
  		break;

--- 590,596 -----
  		if (isup==FALSE) ntn[cntry].tiron += longval;
  		break;
  	case TDJEWL:
! 		if (isup==FALSE) ntn[cntry].jewels += longval;
  		break;
  	case TDLAND:
  		break;
***************
*** 591,597
  	case TDLAND:
  		break;
  	case TDARMY:
! 		ntn[cntry].arm[(int)longval].stat = DEFEND;
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */

--- 595,601 -----
  	case TDLAND:
  		break;
  	case TDARMY:
! 		ntn[cntry].arm[extint].stat = DEFEND;
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */
***************
*** 595,601
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */
! 		ntn[cntry].nvy[(int)longval].armynum = 0;
  		break;
  	}
  }

--- 599,605 -----
  		break;
  	case TDSHIP:
  		/* use armynum to hold indicator */
! 		ntn[cntry].nvy[extint].armynum = 0;
  		break;
  	}
  }
***************
*** 599,605
  		break;
  	}
  }
- #endif CONQUER
  
  #ifdef ADMIN
  /* give things that were purchased from cntry1 to cntry2 */

--- 603,608 -----
  		break;
  	}
  }
  
  #ifdef ADMIN
  /* give things that were purchased from cntry1 to cntry2 */
***************
*** 615,621
  	{
  	case TDGOLD:
  		returnval = longval;
- 		ntn[cntry1].tgold -= longval;
  		ntn[cntry2].tgold += longval * TRADECOST(20);
  		break;
  	case TDFOOD:

--- 618,623 -----
  	{
  	case TDGOLD:
  		returnval = longval;
  		ntn[cntry2].tgold += longval * TRADECOST(20);
  		break;
  	case TDFOOD:
***************
*** 619,629
  		ntn[cntry2].tgold += longval * TRADECOST(20);
  		break;
  	case TDFOOD:
! 		if (ntn[cntry1].tfood >= longval) {
! 			returnval = longval;
! 			ntn[cntry1].tfood -= longval;
! 			ntn[cntry2].tfood += longval * TRADECOST(20);
! 		}
  		break;
  	case TDIRON:
  		if (ntn[cntry1].tiron >= longval) {

--- 621,628 -----
  		ntn[cntry2].tgold += longval * TRADECOST(20);
  		break;
  	case TDFOOD:
! 		returnval = longval;
! 		ntn[cntry2].tfood += longval * TRADECOST(20);
  		break;
  	case TDIRON:
  		ntn[cntry2].tiron += longval * TRADECOST(20);
***************
*** 626,636
  		}
  		break;
  	case TDIRON:
! 		if (ntn[cntry1].tiron >= longval) {
! 			ntn[cntry1].tiron -= longval;
! 			ntn[cntry2].tiron += longval * TRADECOST(20);
! 			returnval = longval;
! 		}
  		break;
  	case TDJEWL:
  		if (ntn[cntry1].jewels >= longval) {

--- 625,632 -----
  		ntn[cntry2].tfood += longval * TRADECOST(20);
  		break;
  	case TDIRON:
! 		ntn[cntry2].tiron += longval * TRADECOST(20);
! 		returnval = longval;
  		break;
  	case TDJEWL:
  		ntn[cntry2].jewels += longval * TRADECOST(20);
***************
*** 633,643
  		}
  		break;
  	case TDJEWL:
! 		if (ntn[cntry1].jewels >= longval) {
! 			ntn[cntry1].jewels -= longval;
! 			ntn[cntry2].jewels += longval * TRADECOST(20);
! 			returnval = longval;
! 		}
  		break;
  	case TDLAND:
  		if (sct[(int)longval][extra].owner==cntry1) {

--- 629,636 -----
  		returnval = longval;
  		break;
  	case TDJEWL:
! 		ntn[cntry2].jewels += longval * TRADECOST(20);
! 		returnval = longval;
  		break;
  	case TDLAND:
  		if (sct[(int)longval][extra].owner==cntry1) {
***************
*** 754,760
  	for (count=0;count<2;count++) {
  		fprintf(fp[count],"%s Message to %s from Conquer Commerce Commision\n",cname[count],cname[count]);
  		fprintf(fp[count],"%s \n",cname[count]);
! 		fprintf(fp[count],"%s   Trade transaction between %s and %s completed.",cname[count],cname[0],cname[1]);
  		if (item1<=TDJEWL)
  		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[0],lvar1,commodities[item1]);
  		else if (item1==TDLAND)

--- 747,753 -----
  	for (count=0;count<2;count++) {
  		fprintf(fp[count],"%s Message to %s from Conquer Commerce Commision\n",cname[count],cname[count]);
  		fprintf(fp[count],"%s \n",cname[count]);
! 		fprintf(fp[count],"%s   Trade transaction between %s and %s completed.\n",cname[count],cname[1],cname[0]);
  		if (item1<=TDJEWL)
  		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[1],lvar1,commodities[item1]);
  		else if (item1==TDLAND)
***************
*** 756,762
  		fprintf(fp[count],"%s \n",cname[count]);
  		fprintf(fp[count],"%s   Trade transaction between %s and %s completed.",cname[count],cname[0],cname[1]);
  		if (item1<=TDJEWL)
! 		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[0],lvar1,commodities[item1]);
  		else if (item1==TDLAND)
  		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[0],lvar1,lvar2);
  		else if (item1==TDARMY)

--- 749,755 -----
  		fprintf(fp[count],"%s \n",cname[count]);
  		fprintf(fp[count],"%s   Trade transaction between %s and %s completed.\n",cname[count],cname[1],cname[0]);
  		if (item1<=TDJEWL)
! 		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[1],lvar1,commodities[item1]);
  		else if (item1==TDLAND)
  		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar1,lvar2);
  		else if (item1==TDARMY)
***************
*** 758,764
  		if (item1<=TDJEWL)
  		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[0],lvar1,commodities[item1]);
  		else if (item1==TDLAND)
! 		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[0],lvar1,lvar2);
  		else if (item1==TDARMY)
  		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[0],lvar1);
  		else if (item1==TDSHIP)

--- 751,757 -----
  		if (item1<=TDJEWL)
  		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[1],lvar1,commodities[item1]);
  		else if (item1==TDLAND)
! 		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar1,lvar2);
  		else if (item1==TDARMY)
  		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[1],lvar1);
  		else if (item1==TDSHIP)
***************
*** 760,766
  		else if (item1==TDLAND)
  		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[0],lvar1,lvar2);
  		else if (item1==TDARMY)
! 		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[0],lvar1);
  		else if (item1==TDSHIP)
  		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[0],lvar1);
  		if (item2<=TDJEWL)

--- 753,759 -----
  		else if (item1==TDLAND)
  		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar1,lvar2);
  		else if (item1==TDARMY)
! 		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[1],lvar1);
  		else if (item1==TDSHIP)
  		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[1],lvar1);
  		if (item2<=TDJEWL)
***************
*** 762,768
  		else if (item1==TDARMY)
  		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[0],lvar1);
  		else if (item1==TDSHIP)
! 		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[0],lvar1);
  		if (item2<=TDJEWL)
  		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[1],lvar3,commodities[item2]);
  		else if (item1==TDLAND)

--- 755,761 -----
  		else if (item1==TDARMY)
  		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[1],lvar1);
  		else if (item1==TDSHIP)
! 		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[1],lvar1);
  		if (item2<=TDJEWL)
  		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[0],lvar3,commodities[item2]);
  		else if (item2==TDLAND)
***************
*** 764,776
  		else if (item1==TDSHIP)
  		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[0],lvar1);
  		if (item2<=TDJEWL)
! 		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[1],lvar3,commodities[item2]);
! 		else if (item1==TDLAND)
! 		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[1],lvar3,lvar4);
! 		else if (item1==TDARMY)
! 		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[1],lvar3);
! 		else if (item1==TDSHIP)
! 		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[1],lvar3);
  		fclose(fp[count]);
  	}
  }

--- 757,770 -----
  		else if (item1==TDSHIP)
  		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[1],lvar1);
  		if (item2<=TDJEWL)
! 		fprintf(fp[count],"%s       Nation %s receives %ld %s\n",cname[count],cname[0],lvar3,commodities[item2]);
! 		else if (item2==TDLAND)
! 		fprintf(fp[count],"%s       Nation %s receives sector %ld, %ld\n",cname[count],cname[0],lvar3,lvar4);
! 		else if (item2==TDARMY)
! 		fprintf(fp[count],"%s       Nation %s receives army #%ld\n",cname[count],cname[0],lvar3);
! 		else if (item2==TDSHIP)
! 		fprintf(fp[count],"%s       Nation %s receives navy #%ld\n",cname[count],cname[0],lvar3);
! 		fprintf(fp[count],"END\n");
  		fclose(fp[count]);
  	}
  }
***************
*** 783,790
  {
  	int oldcntry=country,returnval=FALSE;
  	country=cntry;
! 	if ( ATYPE==A_MERCENARY || ATYPE==A_SEIGE || ATYPE==A_CATAPULT
! 		|| ATYPE==A_ELEPHANT || ATYPE>=MINMONSTER) returnval=TRUE;
  	country=oldcntry;
  	return(returnval);
  }

--- 777,785 -----
  {
  	int oldcntry=country,returnval=FALSE;
  	country=cntry;
! 	if ( (ASTAT!=TRADED) && (ATYPE==A_MERCENARY || ATYPE==A_SEIGE
! 		|| ATYPE==A_CATAPULT || ATYPE==A_ELEPHANT
! 		|| ATYPE>=MINMONSTER) ) returnval=TRUE;
  	country=oldcntry;
  	return(returnval);
  }
***************
*** 806,812
  }
  
  void
! uptrade()
  {
  	FILE *tfile;
  	int count, itemnum=0, natn[MAXITM];

--- 801,807 -----
  }
  
  void
! checktrade()
  {
  	FILE *tfile;
  	int count, itemnum=0, natn[MAXITM];
***************
*** 811,816
  	FILE *tfile;
  	int count, itemnum=0, natn[MAXITM];
  	int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM];
  #ifdef ADMIN
  	extern FILE *fnews;
  	void trademail();

--- 806,842 -----
  	FILE *tfile;
  	int count, itemnum=0, natn[MAXITM];
  	int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM];
+ 	long lvar1[MAXITM], lvar2[MAXITM];
+ 	void takeback();
+ 	void setaside();
+ 	/* initialize purchase list */
+ 	for (count=0; count<MAXITM; count++) {
+ 		deal[count]=(-1);
+ 	}
+ 	/* open trading file */
+ 	if ((tfile = fopen(tradefile,"r")) == NULL) {
+ 		/* no commodities - no transactions */
+ 		return;
+ 	}
+ 	/* read in all of the transactions */
+ 	while(!feof(tfile)) {
+ 		fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum],
+ 			&natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]);
+ 		if (deal[itemnum]==NOSALE) {
+ 			if (natn[itemnum]==country)
+ 			takeback(country,type1[type1[itemnum]],lvar1[type1[itemnum]],extra[type1[itemnum]],TRUE);
+ 		} else if (deal[itemnum]==SELL) {
+ 			if (natn[itemnum]==country)
+ 			setaside(country,type1[itemnum],lvar1[itemnum],extra[itemnum],TRUE);
+ 			itemnum++;
+ 		} else if (deal[itemnum]==BUY) {
+ 			if (natn[itemnum]==country)
+ 			setaside(country,type2[type1[itemnum]],lvar1[itemnum],(int)lvar1[itemnum],TRUE);
+ 		}
+ 	}
+ 	fclose(tfile);
+ }
+ 
  #ifdef ADMIN
  void
  uptrade()
***************
*** 812,817
  	int count, itemnum=0, natn[MAXITM];
  	int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM];
  #ifdef ADMIN
  	extern FILE *fnews;
  	void trademail();
  	int whobuy[MAXITM];

--- 838,849 -----
  }
  
  #ifdef ADMIN
+ void
+ uptrade()
+ {
+ 	FILE *tfile;
+ 	int count, itemnum=0, natn[MAXITM];
+ 	int type1[MAXITM], type2[MAXITM], deal[MAXITM], extra[MAXITM];
  	extern FILE *fnews;
  	void trademail();
  	int whobuy[MAXITM];
***************
*** 817,823
  	int whobuy[MAXITM];
  	long tradeit(), buy1[MAXITM], buy2[MAXITM];
  	long price[MAXITM], gettval(), longval1, longval2;
- #endif ADMIN
  	long lvar1[MAXITM], lvar2[MAXITM];
  #ifdef CONQUER
  	void setaside(),takeback();

--- 849,854 -----
  	int whobuy[MAXITM];
  	long tradeit(), buy1[MAXITM], buy2[MAXITM];
  	long price[MAXITM], gettval(), longval1, longval2;
  	long lvar1[MAXITM], lvar2[MAXITM];
  	void takeback();
  
***************
*** 819,827
  	long price[MAXITM], gettval(), longval1, longval2;
  #endif ADMIN
  	long lvar1[MAXITM], lvar2[MAXITM];
! #ifdef CONQUER
! 	void setaside(),takeback();
! #endif CONQUER
  
  	/* initialize purchase list */
  	for (count=0; count<MAXITM; count++) {

--- 850,856 -----
  	long tradeit(), buy1[MAXITM], buy2[MAXITM];
  	long price[MAXITM], gettval(), longval1, longval2;
  	long lvar1[MAXITM], lvar2[MAXITM];
! 	void takeback();
  
  	/* initialize purchase list */
  	for (count=0; count<MAXITM; count++) {
***************
*** 826,832
  	/* initialize purchase list */
  	for (count=0; count<MAXITM; count++) {
  		deal[count]=(-1);
- #ifdef ADMIN
  		whobuy[count]=(-1);
  		price[count]=(-1);
  #endif ADMIN

--- 855,860 -----
  	/* initialize purchase list */
  	for (count=0; count<MAXITM; count++) {
  		deal[count]=(-1);
  		whobuy[count]=(-1);
  		price[count]=(-1);
  	}
***************
*** 829,835
  #ifdef ADMIN
  		whobuy[count]=(-1);
  		price[count]=(-1);
- #endif ADMIN
  	}
  	/* open trading file */
  	if ((tfile = fopen(tradefile,"r")) == NULL) {

--- 857,862 -----
  		deal[count]=(-1);
  		whobuy[count]=(-1);
  		price[count]=(-1);
  	}
  	/* open trading file */
  	if ((tfile = fopen(tradefile,"r")) == NULL) {
***************
*** 843,851
  		if (deal[itemnum]==NOSALE) {
  			/* remove item from sales list */
  			deal[type1[itemnum]]=NOSALE;
- #ifdef CONQUER
- 			if (natn[itemnum]==country) takeback(country,type1[type1[itemnum]],lvar1[type1[itemnum]]);
- #endif CONQUER
  		} else if (deal[itemnum]==SELL) {
  			itemnum++;
  #ifdef CONQUER

--- 870,875 -----
  		if (deal[itemnum]==NOSALE) {
  			/* remove item from sales list */
  			deal[type1[itemnum]]=NOSALE;
  		} else if (deal[itemnum]==SELL) {
  			itemnum++;
  		} else if (deal[itemnum]==BUY) {
***************
*** 848,856
  #endif CONQUER
  		} else if (deal[itemnum]==SELL) {
  			itemnum++;
- #ifdef CONQUER
- 			if (natn[itemnum]==country) setaside(country,type2[itemnum],lvar1[itemnum]);
- #endif CONQUER
  		} else if (deal[itemnum]==BUY) {
  #ifdef ADMIN
  			if (deal[type1[itemnum]]==SELL) deal[type1[itemnum]]==BUY;

--- 872,877 -----
  			deal[type1[itemnum]]=NOSALE;
  		} else if (deal[itemnum]==SELL) {
  			itemnum++;
  		} else if (deal[itemnum]==BUY) {
  			if (deal[type1[itemnum]]==SELL &&
  			(price[type1[itemnum]] <
***************
*** 852,861
  			if (natn[itemnum]==country) setaside(country,type2[itemnum],lvar1[itemnum]);
  #endif CONQUER
  		} else if (deal[itemnum]==BUY) {
! #ifdef ADMIN
! 			if (deal[type1[itemnum]]==SELL) deal[type1[itemnum]]==BUY;
! 			/* check for highest price for item */
! 			if (price[type1[itemnum]]<gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum])) {
  				price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]);
  				buy1[type1[itemnum]]=lvar1[itemnum];
  				buy2[type1[itemnum]]=lvar2[itemnum];

--- 873,884 -----
  		} else if (deal[itemnum]==SELL) {
  			itemnum++;
  		} else if (deal[itemnum]==BUY) {
! 			if (deal[type1[itemnum]]==SELL &&
! 			(price[type1[itemnum]] <
! 			gettval(natn[type1[itemnum]],natn[itemnum],
! 			type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]))) {
! 				deal[type1[itemnum]]=BUY;
! 				/* highest bid so far */
  				price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]);
  				/* return bid to loser */
  				takeback(whobuy[type1[itemnum]],
***************
*** 857,862
  			/* check for highest price for item */
  			if (price[type1[itemnum]]<gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum])) {
  				price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]);
  				buy1[type1[itemnum]]=lvar1[itemnum];
  				buy2[type1[itemnum]]=lvar2[itemnum];
  				whobuy[type1[itemnum]]=natn[itemnum];

--- 880,890 -----
  				deal[type1[itemnum]]=BUY;
  				/* highest bid so far */
  				price[type1[itemnum]]=gettval(natn[type1[itemnum]],natn[itemnum],type2[type1[itemnum]],lvar1[itemnum],(int)lvar2[itemnum]);
+ 				/* return bid to loser */
+ 				takeback(whobuy[type1[itemnum]],
+ 					type2[type1[itemnum]],
+ 					buy1[type1[itemnum]],extra[type1[itemnum]],FALSE);
+ 				/* record details of trade */
  				buy1[type1[itemnum]]=lvar1[itemnum];
  				buy2[type1[itemnum]]=lvar2[itemnum];
  				whobuy[type1[itemnum]]=natn[itemnum];
***************
*** 860,865
  				buy1[type1[itemnum]]=lvar1[itemnum];
  				buy2[type1[itemnum]]=lvar2[itemnum];
  				whobuy[type1[itemnum]]=natn[itemnum];
  			}
  #endif ADMIN
  #ifdef CONQUER

--- 888,898 -----
  				buy1[type1[itemnum]]=lvar1[itemnum];
  				buy2[type1[itemnum]]=lvar2[itemnum];
  				whobuy[type1[itemnum]]=natn[itemnum];
+ 			} else {
+ 				/* return bid */
+ 				takeback(whobuy[itemnum],
+ 					type2[type1[itemnum]],
+ 					buy1[itemnum],extra[itemnum],FALSE);
  			}
  		}
  	}
***************
*** 861,870
  				buy2[type1[itemnum]]=lvar2[itemnum];
  				whobuy[type1[itemnum]]=natn[itemnum];
  			}
- #endif ADMIN
- #ifdef CONQUER
- 			if (natn[itemnum]==country) setaside(country,type2[type1[itemnum]],lvar1[itemnum]);
- #endif CONQUER
  		}
  	}
  	fclose(tfile);

--- 894,899 -----
  					type2[type1[itemnum]],
  					buy1[itemnum],extra[itemnum],FALSE);
  			}
  		}
  	}
  	unlink(tfile);
***************
*** 867,874
  #endif CONQUER
  		}
  	}
! 	fclose(tfile);
! #ifdef ADMIN
  	/* reopen the file for unsold commodities */
  	if ((tfile=fopen(tradefile,"w")) == NULL) {
  		/* error on opening file */

--- 896,902 -----
  			}
  		}
  	}
! 	unlink(tfile);
  	/* reopen the file for unsold commodities */
  	if ((tfile=fopen(tradefile,"w")) == NULL) {
  		/* error on opening file */
***************
*** 878,884
  
  	/* compute the trading */
  	for (count=0;count<itemnum;count++) {
! 		if (deal[count]==SELL)
  			/* adjust the displayed value */
  			lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]);
  			/* keep unsold items up for sale */

--- 906,912 -----
  
  	/* compute the trading */
  	for (count=0;count<itemnum;count++) {
! 		if (deal[count]==SELL) {
  			/* adjust the displayed value */
  			lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]);
  			/* keep unsold items up for sale */
***************
*** 883,889
  			lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]);
  			/* keep unsold items up for sale */
  			if(lvar1[count]>=0) fprintf(tfile,"%d %d %d %d %ld %ld %d\n", deal[count], natn[count],type1[count],type2[count],lvar1[count],lvar2[count],extra[count]);
! 		else if (deal[count]==BUY) {
  			/* do the trading */
  			longval1 = tradeit(natn[count],whobuy[count],type1[count],lvar1[count],extra[count]);
  			if (longval1!=(-1)) longval2 = tradeit(whobuy[count],natn[count],type2[count],buy1[count],(int)buy2[count]);

--- 911,917 -----
  			lvar1[count]=gettval(0,natn[count],type1[count],lvar1[count],extra[count]);
  			/* keep unsold items up for sale */
  			if(lvar1[count]>=0) fprintf(tfile,"%d %d %d %d %ld %ld %d\n", deal[count], natn[count],type1[count],type2[count],lvar1[count],lvar2[count],extra[count]);
! 		} else if (deal[count]==BUY) {
  			/* do the trading */
  			longval1 = tradeit(natn[count],whobuy[count],type1[count],lvar1[count],extra[count]);
  			if (longval1!=(-1)) longval2 = tradeit(whobuy[count],natn[count],type2[count],buy1[count],(int)buy2[count]);
***************
*** 889,895
  			if (longval1!=(-1)) longval2 = tradeit(whobuy[count],natn[count],type2[count],buy1[count],(int)buy2[count]);
  			if (longval1==(-1)) {
  				/* abort due to seller */
! 				fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.",
  					ntn[natn[count]].name,ntn[whobuy[count]].name,tradefail[type1[count]]);
  			} else if (longval2==(-1)) {
  				/* abort due to buyer */

--- 917,923 -----
  			if (longval1!=(-1)) longval2 = tradeit(whobuy[count],natn[count],type2[count],buy1[count],(int)buy2[count]);
  			if (longval1==(-1)) {
  				/* abort due to seller */
! 				fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.\n",
  					ntn[natn[count]].name,ntn[whobuy[count]].name,tradefail[type1[count]]);
  			} else if (longval2==(-1)) {
  				/* abort due to buyer */
***************
*** 894,900
  			} else if (longval2==(-1)) {
  				/* abort due to buyer */
  				tradeit(whobuy[count],natn[count],type1[count],longval1,extra[count]);
! 				fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.",
  					ntn[whobuy[count]].name,ntn[natn[count]].name,tradefail[type2[count]]);
  				/* place it on the list for next turn */
  				/* adjust the displayed value */

--- 922,928 -----
  			} else if (longval2==(-1)) {
  				/* abort due to buyer */
  				tradeit(whobuy[count],natn[count],type1[count],longval1,extra[count]);
! 				fprintf(fnews,"2.\tTrade between %s and %s breaks down due to %s.\n",
  					ntn[whobuy[count]].name,ntn[natn[count]].name,tradefail[type2[count]]);
  				/* place it on the list for next turn */
  				/* adjust the displayed value */
***************
*** 902,908
  				if(lvar1[count]>=0) fprintf(tfile,"%d %d %d %d %ld %ld %d\n", SELL, natn[count],type1[count],type2[count],lvar1[count],lvar2[count],extra[count]);
  			} else {
  				/* trade completed send mail */
! 				fprintf(fnews,"2.\tNation %s sells %s to %s for %s"
  					,ntn[natn[count]].name,commodities[type1[count]],ntn[whobuy[count]].name,commodities[type2[count]]);
  				trademail(natn[count],whobuy[count],type1[count],
  					type2[count],longval1,(long)extra[count],

--- 930,936 -----
  				if(lvar1[count]>=0) fprintf(tfile,"%d %d %d %d %ld %ld %d\n", SELL, natn[count],type1[count],type2[count],lvar1[count],lvar2[count],extra[count]);
  			} else {
  				/* trade completed send mail */
! 				fprintf(fnews,"2.\tNation %s sells %s to %s for %s\n"
  					,ntn[natn[count]].name,commodities[type1[count]],ntn[whobuy[count]].name,commodities[type2[count]]);
  				trademail(natn[count],whobuy[count],type1[count],
  					type2[count],longval1,(long)extra[count],
***************
*** 911,916
  		}
  	}
  	fclose(tfile);
- #endif ADMIN
  }
  #endif TRADE

--- 939,944 -----
  		}
  	}
  	fclose(tfile);
  }
  #endif ADMIN
  #endif TRADE
***************
*** 913,916
  	fclose(tfile);
  #endif ADMIN
  }
  #endif TRADE

--- 940,945 -----
  	}
  	fclose(tfile);
  }
+ #endif ADMIN
  #endif TRADE
  
***************
*** 914,916
  #endif ADMIN
  }
  #endif TRADE

--- 942,945 -----
  }
  #endif ADMIN
  #endif TRADE
+ 
*** opatchlevel.h	Thu Jul 28 09:10:14 1988
--- patchlevel.h	Thu Jul 28 09:11:13 1988
***************
*** 1,1
! #define PATCHLEVEL	4

--- 1,1 -----
! #define PATCHLEVEL	5
*** oMakefile	Thu Jul 28 09:10:48 1988
--- Makefile	Thu Jul 28 09:15:57 1988
***************
*** 24,30
  #	if they do not use the -d option.
  DEFAULT = /c28/smile/game/default
  
! #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  #	The following CFLAGS should be used if you wish to debug the game
  CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  

--- 24,31 -----
  #	if they do not use the -d option.
  DEFAULT = /c28/smile/game/default
  
! #	The following CFLAGS should be set by a normal user
! CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  #	The following CFLAGS should be used if you wish to debug the game
  #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  
***************
*** 26,32
  
  #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  #	The following CFLAGS should be used if you wish to debug the game
! CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  
  #	this is the name of the user executable
  #	the user executable contains commands for the games players

--- 27,33 -----
  #	The following CFLAGS should be set by a normal user
  CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -O
  #	The following CFLAGS should be used if you wish to debug the game
! #CFLAGS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DDEBUG -g
  
  #	this is the name of the user executable
  #	the user executable contains commands for the games players
***************
*** 211,217
  	$(CC) $(CFLAGS) -DCONQUER -c forms.c
  commands.o:	data.h header.h commands.c
  	$(CC) $(CFLAGS) -DCONQUER -c commands.c
! trade.o:	data.h header.h trade.h trade.c
  	$(CC) $(CFLAGS) -DCONQUER -c trade.c
  tradeA.o:	data.h header.h trade.h trade.c
  	$(CC) $(CFLAGS) -DADMIN -c trade.c

--- 212,218 -----
  	$(CC) $(CFLAGS) -DCONQUER -c forms.c
  commands.o:	data.h header.h commands.c
  	$(CC) $(CFLAGS) -DCONQUER -c commands.c
! trade.o:	data.h header.h trade.c
  	$(CC) $(CFLAGS) -DCONQUER -c trade.c
  tradeA.o:	data.h header.h trade.c
  	$(CC) $(CFLAGS) -DADMIN -c trade.c
***************
*** 213,218
  	$(CC) $(CFLAGS) -DCONQUER -c commands.c
  trade.o:	data.h header.h trade.h trade.c
  	$(CC) $(CFLAGS) -DCONQUER -c trade.c
! tradeA.o:	data.h header.h trade.h trade.c
  	$(CC) $(CFLAGS) -DADMIN -c trade.c
  	mv trade.o tradeA.o

--- 214,219 -----
  	$(CC) $(CFLAGS) -DCONQUER -c commands.c
  trade.o:	data.h header.h trade.c
  	$(CC) $(CFLAGS) -DCONQUER -c trade.c
! tradeA.o:	data.h header.h trade.c
  	$(CC) $(CFLAGS) -DADMIN -c trade.c
  	mv trade.o tradeA.o