[comp.sources.games.bugs] Conquer Official Patch #2 part 1 of 2

adb@bu-cs.BU.EDU (Adam Bryant) (07/09/89)

This is patch number two to conquer version 4.0.
[making it conquer version 4.2!]

see notes.v4 for changes.

Part 1 is a patch file.
Part 2 is a new Makefile.  [Just replace the
 current Makefile with it.]

adam

====================cut here========================
*** opatchlevel.h
--- patchlevel.h
**************
*** 1
! #define PATCHLEVEL	1
--- 1 -----
! #define PATCHLEVEL	2
*** onotes.v4
--- notes.v4
**************
*** 18,23
    9. merged do_lizard() and updlizard().  [used name do_lizard()].
   10. fixed bug with getchar querys in makeworl.c.
   11. fixed bug with y < MAPX mistype in randeven.c.
  
  -------------------------------------------------------------------------
  | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4		|
--- 18,45 -----
    9. merged do_lizard() and updlizard().  [used name do_lizard()].
   10. fixed bug with getchar querys in makeworl.c.
   11. fixed bug with y < MAPX mistype in randeven.c.
+ ===4.0 patch number one released => 4.1 ==========================
+  12. fixed underflow problems with unsigned chars xloc,yloc,xcap,ycap.
+  13. misc.c(834): changed "owner=DCAPITOL" to "designation=DCAPITOL".
+  14. npc.c(171,172): changed rand()%2-1 to rand()%3-1.
+  15. randeven.c: put #ifdef MONSTER around nomad raid section.
+  16. reports.c(618): changed flthold() to fltmhold().
+  17. combat.c(488,510): changed "-=0" to "=0".
+  18. newlogin.c(507): changed temp < points to temp > points.
+  19. newlogin.c(795): added  "& MAPY > 24".
+  20. extcmds.c(365): fixed check on same location for merging groups.
+  21. newhelp.c(163): added #ifdef for RANEVENT to newhelp.c.
+  22. altered map printing routines to send to stdout, and have stderr be
+ 	for communicating with the user.  so now "conqrun -p > foo" works.
+  23. removed password checking under -p option. would only be useful if
+ 	OGOD was defined, and if that was the case, only god could get
+ 	to that point anyway.
+  24. made copyright screen variable with screen size.
+  25. added TIMELOG feature to use system date command to show last update time.
+  26. made errormsg display on COLS-20 instead of 60.  fixed up display bugs.
+  27. added more names to rebel name list.
+  28. worked on Makefile.  [made sure of parallelism; ready to distribute]
+  29. reworded treasury display on budget screen for clarity.
  
  -------------------------------------------------------------------------
  | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4		|
**************
*** 22,27
  -------------------------------------------------------------------------
  | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4		|
  -------------------------------------------------------------------------
  o fix the helpfiles to reflect current changes in game as noted later in this
  	file.
  o there is some overflow somewhere, which creates a huge amount of gold
--- 44,52 -----
  -------------------------------------------------------------------------
  | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4		|
  -------------------------------------------------------------------------
+ o make land capture only occur during update.
+ o make the create world routine interactive with curses display.
+ o make the newlogin routine interactive with curses display.
  o fix the helpfiles to reflect current changes in game as noted later in this
  	file.
  o there is some overflow somewhere, which creates a huge amount of gold
**************
*** 32,38
  o adjust spew.c and write new rules files for
  	1) random npc mail
  	2) npc delcarations of war
! o Treaty war delcarations only last one turn ????  It seems to revert sometimes.
  o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
  o implement sacking of capitol instead of destruction of nation.  This
  	should award all iron, gold and jewels to the successor, but leave
--- 57,63 -----
  o adjust spew.c and write new rules files for
  	1) random npc mail
  	2) npc delcarations of war
! o Treaty war delcarations only last one turn ???? It seems to revert sometimes.
  o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
  o implement new method for detection of captured lands.  if any allies of
  	sector owner in sector, prevent taking of sector;  otherwise, award
**************
*** 34,43
  	2) npc delcarations of war
  o Treaty war delcarations only last one turn ????  It seems to revert sometimes.
  o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
- o implement sacking of capitol instead of destruction of nation.  This
- 	should award all iron, gold and jewels to the successor, but leave
- 	food (or a good portion of it) with the nation owner.  This should
- 	be implemented on all nations, including pcs.
  o implement new method for detection of captured lands.  if any allies of
  	sector owner in sector, prevent taking of sector;  otherwise, award
  	sector to nation with more troops if troops are twice the remaining
--- 59,64 -----
  	2) npc delcarations of war
  o Treaty war delcarations only last one turn ???? It seems to revert sometimes.
  o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
  o implement new method for detection of captured lands.  if any allies of
  	sector owner in sector, prevent taking of sector;  otherwise, award
  	sector to nation with more troops if troops are twice the remaining
**************
*** 57,63
    in a city will have a 50% (+5% for added leader) chance of stopping a bad 
    event.
  o All units should have loyalty ratings, and can revolt.  
- o Newlogin setup should be revamped to use curses display.  Better control.
  o Revamp user help interface to allow searching through help files.
  o leader experience.  mail to nation if happen.  This has untold impacts on
  	combat... and i dont want to touch it yet. sorry.
--- 78,83 -----
    in a city will have a 50% (+5% for added leader) chance of stopping a bad 
    event.
  o All units should have loyalty ratings, and can revolt.  
  o Revamp user help interface to allow searching through help files.
  o leader experience.  mail to nation if happen.  This has untold impacts on
  	combat... and i dont want to touch it yet. sorry.
*** oheader.h
--- header.h
**************
*** 49,54
  #define SPOOLDIR "/usr/spool/mail"	/* location of mail spool	*/
  #define FILELOCK	/* if your system supports BSD flock()		*/
  			/* other file locking is not well implemented	*/
  
  #define NTOTAL 25	/* max # of nations ( player + npc + monster )	*/
  #define MAXPTS	65	/* points for players to buy stuff with at start*/
--- 49,55 -----
  #define SPOOLDIR "/usr/spool/mail"	/* location of mail spool	*/
  #define FILELOCK	/* if your system supports BSD flock()		*/
  			/* other file locking is not well implemented	*/
+ #define TIMELOG	/* if your system has the date command		*/
  
  #define NTOTAL 25	/* max # of nations ( player + npc + monster )	*/
  #define MAXPTS	65	/* points for players to buy stuff with at start*/
*** odata.h
--- data.h
**************
*** 900,906
  extern	int	unitmove[], unitattack[], unitdefend[];
  
  /*	file name definitions	*/
! extern	char *sortname,*exefile,*datafile,*msgfile,*helpfile,*newsfile,*isonfile;
  
  #ifdef CONQUER
  extern	int	conq_mail_status;
--- 900,907 -----
  extern	int	unitmove[], unitattack[], unitdefend[];
  
  /*	file name definitions	*/
! extern	char *sortname,*exefile,*datafile,*msgfile;
! extern	char *helpfile,*newsfile,*isonfile,*timefile;
  
  #ifdef CONQUER
  extern	int	conq_mail_status;
*** oadmin.c
--- admin.c
**************
*** 178,195
  		unlink(string);
  		exit(SUCCESS);
  	} else if (pflag) {	/* print a map of the game */
! #ifdef OGOD
! 		if(strncmp(crypt(getpass("\nwhat is conquer super user password:"),SALT),ntn[0].passwd,PASSLTH)!=0) {
! 			printf("sorry, must be super user to get map\n");
! 			exit(FAIL);
! 		}
! #endif OGOD
! 		printf("For Convienience, output is to stderr\n");
! 		printf("what type of map\noptions are\n");
! 		printf("\t1) altitudes\n\t2) vegetations\n");
! 		printf("\t3) nations\n\n");
! 		printf("\tINPUT:");
! 		scanf("%hd",&dismode);
  		if(dismode==1) printele();
  		else if(dismode==2) printveg();
  		else pr_ntns();
--- 178,191 -----
  		unlink(string);
  		exit(SUCCESS);
  	} else if (pflag) {	/* print a map of the game */
! 		fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
! 		fprintf(stderr,"while the maps will be sent to stdout.\n\n");
! 		fprintf(stderr,"\tThe valid options are,\n");
! 		fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
! 		fprintf(stderr,"\t\t3) nations\n\n");
! 		fprintf(stderr,"\tWhat type of map? ");
! 		scanf("%hd", &dismode);
! 		fprintf(stderr,"\n");
  		if(dismode==1) printele();
  		else if(dismode==2) printveg();
  		else pr_ntns();
**************
*** 222,227
  		update();
  		writedata();
  		unlink(string);
  		exit(SUCCESS);
  	}
  	printf("error: must specify an option\n");
--- 218,227 -----
  		update();
  		writedata();
  		unlink(string);
+ #ifdef TIMELOG
+ 		sprintf(string, "date > %s", timefile);
+ 		system(string);
+ #endif /* TIMELOG */
  		exit(SUCCESS);
  	}
  	printf("error: must specify an option\n");
*** oextcmds.c
--- extcmds.c
**************
*** 269,276
  		return;
  	}
  
! 	oldx=P_AXLOC;
! 	oldy=P_AYLOC;
  	army2=armynum;
  
  	armynum=(-1);
--- 269,276 -----
  		return;
  	}
  
! 	oldx=(int)P_AXLOC;
! 	oldy=(int)P_AYLOC;
  	army2=armynum;
  
  	armynum=(-1);
**************
*** 317,323
  {
  	mvaddstr(LINES-1, 0, str);
  	clrtoeol();
! 	mvaddstr(LINES-1, 60, "PRESS ANY KEY");
  	beep();
  	refresh();
  	getch();
--- 317,323 -----
  {
  	mvaddstr(LINES-1, 0, str);
  	clrtoeol();
! 	mvaddstr(LINES-1, COLS-20, "PRESS ANY KEY");
  	beep();
  	refresh();
  	getch();
**************
*** 362,368
  		return;
  	}
  	if((P_AXLOC != curntn->arm[group].xloc)
! 	&&(P_AXLOC != curntn->arm[group].xloc)){
  		errormsg("units are not in same sector");
  		return;
  	}
--- 362,368 -----
  		return;
  	}
  	if((P_AXLOC != curntn->arm[group].xloc)
! 	||(P_AYLOC != curntn->arm[group].yloc)){
  		errormsg("units are not in same sector");
  		return;
  	}
*** omakeworl.c
--- makeworl.c
**************
*** 45,51
  int	rflag;		/* TRUE if you wish to read in a map from mapfiles */
  {
  	char passwd[PASSLTH+1],*getpass();
! 	char newstring[100];
  	FILE *fopen();
  
  	/*abort if datafile currently exists*/
--- 45,51 -----
  int	rflag;		/* TRUE if you wish to read in a map from mapfiles */
  {
  	char passwd[PASSLTH+1],*getpass();
! 	char newstring[200];
  	FILE *fopen();
  
  	/*abort if datafile currently exists*/
**************
*** 70,76
  
  	printf("First, we must zero extraneous files from prior games\n");
  	printf("\tignore any errors this causes\n");
! 	sprintf(newstring,"rm -f %s* %s* %s* %s* %s 2> /dev/null",exefile,msgfile,newsfile,isonfile,tradefile);
  	printf("\t%s\n",newstring);
  	system(newstring);
  	printf("OK This has been done, Now to set up a new world\n\n");
--- 70,77 -----
  
  	printf("First, we must zero extraneous files from prior games\n");
  	printf("\tignore any errors this causes\n");
! 	sprintf(newstring,"rm -f %s* %s* %s* %s* %s %s 2> /dev/null",
! 		exefile, msgfile, newsfile, isonfile, tradefile, timefile);
  	printf("\t%s\n",newstring);
  	system(newstring);
  	printf("OK This has been done, Now to set up a new world\n\n");
*** osort.c
--- sort.c
**************
*** 27,32
   * Initial Revision:		(adb@bucsf.bu.edu)
   *     Tuesday March 21th, 1989 - Began the program at 23:26 EST
   *     Wednesday March 22nd, 1989 - Finished the initial version 11:29 EST
   */
  
  #include <stdio.h>
--- 27,33 -----
   * Initial Revision:		(adb@bucsf.bu.edu)
   *     Tuesday March 21th, 1989 - Began the program at 23:26 EST
   *     Wednesday March 22nd, 1989 - Finished the initial version 11:29 EST
+  *     Wednesday July 5th, 1989 - Stopped use of sysexits.h 7:22 EST
   */
  
  #include <stdio.h>
**************
*** 30,38
   */
  
  #include <stdio.h>
- #ifndef HPUX
- #include <sysexits.h>
- #endif HPUX
  #include <ctype.h>
  
  /* system definitions just in case */
--- 31,36 -----
   */
  
  #include <stdio.h>
  #include <ctype.h>
  
  /* system definitions just in case */
**************
*** 39,45
  #ifndef FALSE
  #define FALSE (0)
  #define TRUE  (1)
! #endif
  
  /* check for system exit definitions */
  #ifndef EX_OK
--- 37,43 -----
  #ifndef FALSE
  #define FALSE (0)
  #define TRUE  (1)
! #endif /* FALSE */
  
  /* system exit definitions from sysexits.h on BSD machines */
  #ifndef EX_OK
**************
*** 41,47
  #define TRUE  (1)
  #endif
  
! /* check for system exit definitions */
  #ifndef EX_OK
  #define EX_OK             0   /* successful termination */
  #define EX_USAGE          64  /* invalid command line format */
--- 39,45 -----
  #define TRUE  (1)
  #endif /* FALSE */
  
! /* system exit definitions from sysexits.h on BSD machines */
  #ifndef EX_OK
  #define EX_OK             0   /* successful termination */
  #define EX_USAGE          64  /* invalid command line format */
**************
*** 48,54
  #define EX_NOINPUT        66  /* could not open input file */
  #define EX_SOFTWARE       70  /* software error; couldn't malloc */
  #define EX_CANTCREAT      73  /* could not create output file */
! #endif
  
  /* number of characters to compare by default */
  #define DEFAULT_COMP 2
--- 46,52 -----
  #define EX_NOINPUT        66  /* could not open input file */
  #define EX_SOFTWARE       70  /* software error; couldn't malloc */
  #define EX_CANTCREAT      73  /* could not create output file */
! #endif /* EX_OK */
  
  /* number of characters to compare by default */
  #define DEFAULT_COMP 2
*** orandeven.c
--- randeven.c
**************
*** 5,11
  #include	"data.h"
  
  #ifdef RANEVENT
- #ifdef ADMIN
  char	*names[] = {		/* must end in single character name */
  	"groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
  	"lynn","zorb","theed","urda","X"
--- 5,10 -----
  #include	"data.h"
  
  #ifdef RANEVENT
  char	*names[] = {		/* must end in single character name */
  	"groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
  	"lynn","zorb","theed","urda","anima","bedlam","delos","quin",
**************
*** 8,14
  #ifdef ADMIN
  char	*names[] = {		/* must end in single character name */
  	"groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
! 	"lynn","zorb","theed","urda","X"
  };
  
  extern FILE *fnews;
--- 7,14 -----
  #ifdef RANEVENT
  char	*names[] = {		/* must end in single character name */
  	"groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
! 	"lynn","zorb","theed","urda","anima","bedlam","delos","quin",
! 	"xynd","putz","erde","clym","fanz","ilth","X"
  };
  
  extern FILE *fnews;
**************
*** 556,561
  			curntn->jewels+=longval;
  			break;
  		case 25:
  			/*nomad raid -- put large nomad army in area*/
  			for( holdval=1;holdval<NTOTAL;holdval++ )
  				if( ntn[holdval].active==NPC_NOMAD ) break;
--- 556,562 -----
  			curntn->jewels+=longval;
  			break;
  		case 25:
+ #ifdef MONSTER
  			/*nomad raid -- put large nomad army in area*/
  			for( holdval=1;holdval<NTOTAL;holdval++ )
  				if( ntn[holdval].active==NPC_NOMAD ) break;
**************
*** 591,596
  			}
  			done=TRUE;
  			break;
  		case 26:
  			/*town burns -- reduce fort and redesignate*/
  			holdval=0;
--- 592,598 -----
  			}
  			done=TRUE;
  			break;
+ #endif MONSTER
  		case 26:
  			/*town burns -- reduce fort and redesignate*/
  			holdval=0;
**************
*** 1105,1109
  weather()
  {
  }
- #endif ADMIN
  #endif RANEVENT
--- 1107,1110 -----
  weather()
  {
  }
  #endif RANEVENT
*** omisc.c
--- misc.c
**************
*** 831,837
  	} else if(isnpc(curntn->active)) {
  		if(sct[curntn->capx][curntn->capy].owner==country) {
  			/* reset capitol for npcs */
! 			sct[curntn->capx][curntn->capy].owner=DCAPITOL;
  			if(sct[curntn->capx][curntn->capy].fortress<1)
  				sct[curntn->capx][curntn->capy].fortress=1;
  		}
--- 831,837 -----
  	} else if(isnpc(curntn->active)) {
  		if(sct[curntn->capx][curntn->capy].owner==country) {
  			/* reset capitol for npcs */
! 			sct[curntn->capx][curntn->capy].designation=DCAPITOL;
  			if(sct[curntn->capx][curntn->capy].fortress<1)
  				sct[curntn->capx][curntn->capy].fortress=1;
  		}
*** oreports.c
--- reports.c
**************
*** 91,98
  				standend();
  				mvprintw(ypos+1,xpos,"%ld",P_ASOLD);
  				mvprintw(ypos+2,xpos,"%d",P_AMOVE);
! 				mvprintw(ypos+3,xpos,"%d",P_AXLOC);
! 				mvprintw(ypos+4,xpos,"%d",P_AYLOC);
  				if(P_ASTAT>=NUMSTATUS)
  				mvprintw(ypos+5,xpos,"group %d",P_ASTAT-NUMSTATUS);
  				else
--- 91,98 -----
  				standend();
  				mvprintw(ypos+1,xpos,"%ld",P_ASOLD);
  				mvprintw(ypos+2,xpos,"%d",P_AMOVE);
! 				mvprintw(ypos+3,xpos,"%d",(int)P_AXLOC);
! 				mvprintw(ypos+4,xpos,"%d",(int)P_AYLOC);
  				if(P_ASTAT>=NUMSTATUS)
  				mvprintw(ypos+5,xpos,"group %d",P_ASTAT-NUMSTATUS);
  				else
**************
*** 328,334
  	standout();
  	mvprintw(3,0,  "nation name is......%s",curntn->name);
  	standend();
! 	mvprintw(4,0,  "talons in treasury.$%ld",startgold);
  	mvprintw(5,0,  "number of sectors...%d",spread.sectors);
  	if(curntn->tfood<2*curntn->tciv) standout();
  	mvprintw(7,0,  "granary holds.....%8ld",curntn->tfood);
--- 328,334 -----
  	standout();
  	mvprintw(3,0,  "nation name is......%s",curntn->name);
  	standend();
! 	mvprintw(4,0,  "starting treasury..$%ld",startgold);
  	mvprintw(5,0,  "number of sectors...%d",spread.sectors);
  	if(curntn->tfood<2*curntn->tciv) standout();
  	mvprintw(7,0,  "granary holds.....%8ld",curntn->tfood);
**************
*** 355,361
  	money=spread.gold - curntn->tgold - money;	/* net income */
  	standend();
  	mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
! 	mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*curntn->charity)/100,0));
  	standout();
  	mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100-curntn->charity)/100);
  
--- 355,361 -----
  	money=spread.gold - curntn->tgold - money;	/* net income */
  	standend();
  	mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
! 	mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*(long)curntn->charity)/100L,0L));
  	standout();
  	mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100L-(long)curntn->charity)/100L);
  
**************
*** 357,363
  	mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
  	mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*curntn->charity)/100,0));
  	standout();
! 	mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100-curntn->charity)/100);
  
  	mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
  	mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
--- 357,363 -----
  	mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
  	mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*(long)curntn->charity)/100L,0L));
  	standout();
! 	mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100L-(long)curntn->charity)/100L);
  
  	mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
  	mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
**************
*** 408,414
  	standout();
  	mvprintw(4,0,  "nation name is....%s",curntn->name);
  	standend();
! 	mvprintw(5,0,  "talons in treasury..$%ld",startgold);
  	mvaddstr(7,0,  "FOOD PRODUCTION");
  	mvprintw(9,0,  "granary now holds.........%8ld tons",curntn->tfood);
  	mvprintw(10,0, "%8ld people in farms..%8ld tons",spread.infarm,spread.food - curntn->tfood);
--- 408,414 -----
  	standout();
  	mvprintw(4,0,  "nation name is....%s",curntn->name);
  	standend();
! 	mvprintw(5,0,  "talons in treasury..$%ld",curntn->tgold);
  	mvaddstr(7,0,  "FOOD PRODUCTION");
  	mvprintw(9,0,  "granary now holds.........%8ld tons",curntn->tfood);
  	mvprintw(10,0, "%8ld people in farms..%8ld tons",spread.infarm,spread.food - curntn->tfood);
**************
*** 615,621
  					crew = flthold(nvynum)*P_NCREW;
  					people = fltmhold(nvynum)*P_NPEOP;
  					crew += flthold(newnavy)*curntn->nvy[newnavy].crew;
! 					people += flthold(newnavy)*curntn->nvy[newnavy].people;
  					for(i=N_LIGHT;i<=N_HEAVY;i++) {
  						(void) addwships(newnavy,i,P_NWAR(i));
  						(void) addmships(newnavy,i,P_NMER(i));
--- 615,621 -----
  					crew = flthold(nvynum)*P_NCREW;
  					people = fltmhold(nvynum)*P_NPEOP;
  					crew += flthold(newnavy)*curntn->nvy[newnavy].crew;
! 					people += fltmhold(newnavy)*curntn->nvy[newnavy].people;
  					for(i=N_LIGHT;i<=N_HEAVY;i++) {
  						(void) addwships(newnavy,i,P_NWAR(i));
  						(void) addmships(newnavy,i,P_NMER(i));
*** ocombat.c
--- combat.c
**************
*** 484,491
  				Aloss+=loss;
  				ntn[owner[i]].arm[unit[i]].sold-=loss;
  				if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==ATKR)) {
! 				sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
! 				ntn[owner[i]].arm[unit[i]].sold-=0;
  				}
  			}
  		} else if(side[i]==DFND){
--- 484,491 -----
  				Aloss+=loss;
  				ntn[owner[i]].arm[unit[i]].sold-=loss;
  				if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==ATKR)) {
! 					sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
! 					ntn[owner[i]].arm[unit[i]].sold=0;
  				}
  			}
  		} else if(side[i]==DFND){
**************
*** 506,513
  				Dloss+=loss;
  				ntn[owner[i]].arm[unit[i]].sold-=loss;
  				if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==DFND)) {
! 				sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
! 				ntn[owner[i]].arm[unit[i]].sold-=0;
  				}
  			}
  		}
--- 506,513 -----
  				Dloss+=loss;
  				ntn[owner[i]].arm[unit[i]].sold-=loss;
  				if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==DFND)) {
! 					sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
! 					ntn[owner[i]].arm[unit[i]].sold=0;
  				}
  			}
  		}
*** omove.c
--- move.c
**************
*** 165,171
  				}
  				for(i=0;i<MAXARM;i++) if(curntn->arm[i].sold>0){
  					standout();
! 					see(curntn->arm[i].xloc-xoffset,curntn->arm[i].yloc-yoffset);
  				}
  					for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
  					standout();
--- 165,171 -----
  				}
  				for(i=0;i<MAXARM;i++) if(curntn->arm[i].sold>0){
  					standout();
! 					see((int)curntn->arm[i].xloc-xoffset,(int)curntn->arm[i].yloc-yoffset);
  				}
  					for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
  					standout();
**************
*** 169,175
  				}
  					for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
  					standout();
! 					see(curntn->nvy[i].xloc-xoffset,curntn->nvy[i].yloc-yoffset);
  
  				}
  			} else for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
--- 169,175 -----
  				}
  					for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
  					standout();
! 					see((int)curntn->nvy[i].xloc-xoffset,(int)curntn->nvy[i].yloc-yoffset);
  
  				}
  			} else for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
*** oupdate.c
--- update.c
**************
*** 271,280
  		||( P_ATYPE>=MINLEADER)) menok=TRUE;
  		else menok=FALSE;
  		/* range of 4 if menok is FALSE else 2 */
! 		for(x=P_AXLOC-4+menok*2;x<=P_AXLOC+4-menok*2;x++)
! 		for(y=P_AYLOC-4+menok*2;y<=P_AYLOC+4-menok*2;y++) if(ONMAP(x,y))
! 			if( menok==TRUE || ISCITY(sct[x][y].designation) )
! 				sum+=attr[x][y];
  	}
  
  	if(sum==0) {
--- 271,283 -----
  		||( P_ATYPE>=MINLEADER)) menok=TRUE;
  		else menok=FALSE;
  		/* range of 4 if menok is FALSE else 2 */
! 		for(x=(int)P_AXLOC-4+menok*2;x<=(int)P_AXLOC+4-menok*2;x++)
! 		for(y=(int)P_AYLOC-4+menok*2;y<=(int)P_AYLOC+4-menok*2;y++) {
! 			if(ONMAP(x,y)) {
! 				if( menok==TRUE || ISCITY(sct[x][y].designation) )
! 					sum+=attr[x][y];
! 			}
! 		}
  	}
  
  	if(sum==0) {
**************
*** 313,320
  	} else {
  		where=rand()%sum;
  		/* range of 4 if menok is FALSE else 2 */
! 		for(x=P_AXLOC-4+menok*2;x<=P_AXLOC+4-menok*2;x++)
! 		for(y=P_AYLOC-4+menok*2;y<=P_AYLOC+4-menok*2;y++) if(ONMAP(x,y)){
  			if( menok==TRUE || ISCITY(sct[x][y].designation) )
  				where -= attr[x][y];
  			if( (where < 0 )
--- 316,324 -----
  	} else {
  		where=rand()%sum;
  		/* range of 4 if menok is FALSE else 2 */
! 		for(x=(int)P_AXLOC-4+menok*2;x<=(int)P_AXLOC+4-menok*2;x++)
! 		for(y=(int)P_AYLOC-4+menok*2;y<=(int)P_AYLOC+4-menok*2;y++)
! 		if(ONMAP(x,y)){
  			if( menok==TRUE || ISCITY(sct[x][y].designation) )
  				where -= attr[x][y];
  			if( (where < 0 )
**************
*** 320,326
  			if( (where < 0 )
  			&& movecost[x][y]>=1
  			&& movecost[x][y]<=P_AMOVE
! 			&&(land_reachp(P_AXLOC,P_AYLOC,x,y,P_AMOVE,country))){
  				P_AXLOC=x;
  				P_AYLOC=y;
  				if(P_ATYPE == getleader(curntn->class)-1 ){
--- 324,330 -----
  			if( (where < 0 )
  			&& movecost[x][y]>=1
  			&& movecost[x][y]<=P_AMOVE
! 			&&(land_reachp((int)P_AXLOC,(int)P_AYLOC,x,y,P_AMOVE,country))){
  				P_AXLOC=x;
  				P_AYLOC=y;
  				if(P_ATYPE == getleader(curntn->class)-1 ){
**************
*** 355,361
  
  		/*do again - have this block if lots of bad terrain*/
  		/*what could happen is that it won't find a move first time*/
! 		for(x=P_AXLOC-2;x<=P_AXLOC+2;x++) for(y=P_AYLOC-2;y<=P_AYLOC+2;y++) {
  			if(!ONMAP(x,y))
  				continue;
  
--- 359,366 -----
  
  		/*do again - have this block if lots of bad terrain*/
  		/*what could happen is that it won't find a move first time*/
! 		for(x=(int)P_AXLOC-2;x<=(int)P_AXLOC+2;x++)
! 		for(y=(int)P_AYLOC-2;y<=(int)P_AYLOC+2;y++) {
  			if(!ONMAP(x,y))
  				continue;
  
**************
*** 613,620
  		}
  
  		/*if near capitol add to attr*/
! 		for(x=curntn->capx-2;x<=curntn->capx+2;x++)
! 			for(y=curntn->capy-2;y<=curntn->capy+2;y++)
  				if((ONMAP(x,y))&&(attr[x][y]>0)) attr[x][y]+=20;
  
  /*MOVE CIVILIANS based on the ratio of attractivenesses
--- 618,625 -----
  		}
  
  		/*if near capitol add to attr*/
! 		for(x=(int)curntn->capx-2;x<=(int)curntn->capx+2;x++)
! 			for(y=(int)curntn->capy-2;y<=(int)curntn->capy+2;y++)
  				if((ONMAP(x,y))&&(attr[x][y]>0)) attr[x][y]+=20;
  
  /*MOVE CIVILIANS based on the ratio of attractivenesses
**************
*** 695,702
  			/* try to relieve sieges */
  			if(P_ASTAT!=SIEGED
  			&& ntn[country].arm[armynum-1].stat!=SIEGED) {
! 			for(i=ntn[country].arm[armynum-1].xloc-1;i<=ntn[country].arm[armynum-1].xloc+1;i++) {
! 				for(j=ntn[country].arm[armynum-1].yloc-1;j<=ntn[country].arm[armynum-1].yloc+1;j++) {
  					if(ONMAP(i,j)
  					&&(sct[i][j].altitude!=WATER) 
  					&&(sct[i][j].altitude!=PEAK) 
--- 700,707 -----
  			/* try to relieve sieges */
  			if(P_ASTAT!=SIEGED
  			&& ntn[country].arm[armynum-1].stat!=SIEGED) {
! 			for(i=(int)ntn[country].arm[armynum-1].xloc-1;i<=ntn[country].arm[armynum-1].xloc+1;i++) {
! 				for(j=(int)ntn[country].arm[armynum-1].yloc-1;j<=ntn[country].arm[armynum-1].yloc+1;j++) {
  					if(ONMAP(i,j)
  					&&(sct[i][j].altitude!=WATER) 
  					&&(sct[i][j].altitude!=PEAK) 
**************
*** 804,810
  						fprintf(fm,"Message from Conquer\n\n");
  						fprintf(fm,"\tYour Scouting Unit %d was captured\n");
  						fprintf(fm,"\t  by %s military in sector %d,%d\n",
! 							ntn[occval].name,P_AXLOC,P_AYLOC);
  						mailclose();
  					}
  					if (ispc(ntn[occval].active)) {
--- 809,815 -----
  						fprintf(fm,"Message from Conquer\n\n");
  						fprintf(fm,"\tYour Scouting Unit %d was captured\n");
  						fprintf(fm,"\t  by %s military in sector %d,%d\n",
! 							ntn[occval].name,(int)P_AXLOC,(int)P_AYLOC);
  						mailclose();
  					}
  					if (ispc(ntn[occval].active)) {
**************
*** 811,817
  						mailopen(occval);
  						fprintf(fm,"Message from Conquer\n\n");
  						fprintf(fm,"\tA Scout from nation %s was captured\n",curntn->name);
! 						fprintf(fm,"\t  in sector %d,%d.\n",P_AXLOC,P_AYLOC);
  						mailclose();
  					}
  				}
--- 816,822 -----
  						mailopen(occval);
  						fprintf(fm,"Message from Conquer\n\n");
  						fprintf(fm,"\tA Scout from nation %s was captured\n",curntn->name);
! 						fprintf(fm,"\t  in sector %d,%d.\n",(int)P_AXLOC,(int)P_AYLOC);
  						mailclose();
  					}
  				}
*** ocommands.c
--- commands.c
**************
*** 875,881
  		if(isgod==TRUE) reset_god();
  		return;
  	} else if(i_cost > curntn->metals) {
! 		mvprintw(LINES-2,0,"You don't have %ld metal",i_cost);
  		clrtoeol();
  		refresh();
  		getch();
--- 875,882 -----
  		if(isgod==TRUE) reset_god();
  		return;
  	} else if(i_cost > curntn->metals) {
! 		mvprintw(LINES-1,0,"You don't have %ld metal",i_cost);
! 		mvprintw(LINES-1,COLS-20,"PRESS ANY KEY");
  		clrtoeol();
  		refresh();
  		getch();
**************
*** 959,965
  			P_AYLOC = ntn[i].capy;
  			P_AXLOC = ntn[i].capx;
  			mvprintw(LINES-2,0,"The Spy Starts in %s's Capitol (%d,%d)",
! 				ntn[i].name,P_AXLOC,P_AYLOC);
  			clrtoeol();
  		} else {
  			clear_bottom(0);
--- 960,966 -----
  			P_AYLOC = ntn[i].capy;
  			P_AXLOC = ntn[i].capx;
  			mvprintw(LINES-2,0,"The Spy Starts in %s's Capitol (%d,%d)",
! 				ntn[i].name,(int)P_AXLOC,(int)P_AYLOC);
  			clrtoeol();
  		} else {
  			clear_bottom(0);
**************
*** 973,979
  			P_AYLOC = YREAL;
  			P_AXLOC = XREAL;
  			mvprintw(LINES-2,0,"Intelligence indicates that %s lies to the %s",ntn[i].name,
! 				  *(directions+compass(P_AXLOC,P_AYLOC,ntn[i].capx,ntn[i].capy)));
  			clrtoeol();
  		}
  		errormsg("");
--- 974,981 -----
  			P_AYLOC = YREAL;
  			P_AXLOC = XREAL;
  			mvprintw(LINES-2,0,"Intelligence indicates that %s lies to the %s",ntn[i].name,
! 				*(directions+compass((int)P_AXLOC,(int)P_AYLOC,
! 				  (int)ntn[i].capx,(int)ntn[i].capy)));
  			clrtoeol();
  		}
  		errormsg("");
**************
*** 1294,1301
  		if(P_ASOLD <= 0) return(0);
  	}
  	/*move to correct location*/
! 	xcurs = P_AXLOC - xoffset;
! 	ycurs = P_AYLOC - yoffset;
  	coffmap();
  
  	/*select correct unit*/
--- 1296,1303 -----
  		if(P_ASOLD <= 0) return(0);
  	}
  	/*move to correct location*/
! 	xcurs = (int)P_AXLOC - xoffset;
! 	ycurs = (int)P_AYLOC - yoffset;
  	coffmap();
  
  	/*select correct unit*/
*** oio.c
--- io.c
**************
*** 47,53
  printele()
  {
  	register int X, Y;
! 	printf("doing print of altitude\n");
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) putc(sct[X][Y].altitude,stdout);
  		putc('\n',stdout);
--- 47,53 -----
  printele()
  {
  	register int X, Y;
! 	fprintf(stderr,"doing print of altitude\n");
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) putc(sct[X][Y].altitude,stdout);
  		putc('\n',stdout);
**************
*** 62,68
  pr_ntns()
  {
  	register int X, Y;
! 	printf("doing print of nations\n");
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) {
  			if(sct[X][Y].owner==0)
--- 62,68 -----
  pr_ntns()
  {
  	register int X, Y;
! 	fprintf(stderr,"doing print of nations\n");
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) {
  			if(sct[X][Y].owner==0)
**************
*** 66,73
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) {
  			if(sct[X][Y].owner==0)
! 				putc(sct[X][Y].altitude,stderr);
! 			else putc(ntn[sct[X][Y].owner].mark,stderr);
  		}
  		putc('\n',stderr);
  	}
--- 66,73 -----
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) {
  			if(sct[X][Y].owner==0)
! 				putc(sct[X][Y].altitude,stdout);
! 			else putc(ntn[sct[X][Y].owner].mark,stdout);
  		}
  		putc('\n',stdout);
  	}
**************
*** 69,75
  				putc(sct[X][Y].altitude,stderr);
  			else putc(ntn[sct[X][Y].owner].mark,stderr);
  		}
! 		putc('\n',stderr);
  	}
  }
  #endif ADMIN
--- 69,75 -----
  				putc(sct[X][Y].altitude,stdout);
  			else putc(ntn[sct[X][Y].owner].mark,stdout);
  		}
! 		putc('\n',stdout);
  	}
  }
  #endif ADMIN
**************
*** 124,130
  
  	/*read in existing nation army and navy data*/
  	/*check if file openable*/
! 	printf("reading data file\n");
  	if( (fd = open(datafile,0)) < 0 ) {
  		fprintf( stderr, "can not open %s \n", datafile );
  		fprintf( stderr, "for help with conquer, type conquer -h\n");
--- 124,130 -----
  
  	/*read in existing nation army and navy data*/
  	/*check if file openable*/
! 	fprintf(stderr,"reading data file\n");
  	if( (fd = open(datafile,0)) < 0 ) {
  		fprintf( stderr, "can not open %s \n", datafile );
  		fprintf( stderr, "for help with conquer, type conquer -h\n");
**************
*** 176,182
  printveg()
  {
  	register int X, Y;
! 	printf("doing print of vegetation\n");
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stderr);
  		putc('\n',stderr);
--- 176,182 -----
  printveg()
  {
  	register int X, Y;
! 	fprintf(stderr,"doing print of vegetation\n");
  	for(Y=0;Y<MAPY;Y++) {
  		for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stdout);
  		putc('\n',stdout);
**************
*** 178,185
  	register int X, Y;
  	printf("doing print of vegetation\n");
  	for(Y=0;Y<MAPY;Y++) {
! 		for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stderr);
! 		putc('\n',stderr);
  	}
  }
  #endif ADMIN
--- 178,185 -----
  	register int X, Y;
  	fprintf(stderr,"doing print of vegetation\n");
  	for(Y=0;Y<MAPY;Y++) {
! 		for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stdout);
! 		putc('\n',stdout);
  	}
  }
  #endif ADMIN
**************
*** 268,273
  {
  	int i;
  	int nationid; 	/*current nation id */
  
  	printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
  		PSEASON(TURN),YEAR(TURN), TURN);
--- 268,277 -----
  {
  	int i;
  	int nationid; 	/*current nation id */
+ #ifdef TIMELOG
+ 	FILE *timefp, *fopen();
+ 	char timestr[80];
+ #endif /* TIMELOG */
  
  	printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
  		PSEASON(TURN),YEAR(TURN), TURN);
**************
*** 271,276
  
  	printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
  		PSEASON(TURN),YEAR(TURN), TURN);
  	printf("id      name   race    class    align  score    talons military  civilians sect\n");
  	for (nationid=1; nationid<NTOTAL; nationid++) {
  		if(!isntn(ntn[nationid].active)) continue;
--- 275,287 -----
  
  	printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
  		PSEASON(TURN),YEAR(TURN), TURN);
+ #ifdef TIMELOG
+ 	if ((timefp=fopen(timefile,"r"))!=NULL) {
+ 		fgets(timestr, 50, timefp);
+ 		printf("Last Update: %s", timestr);
+ 		fclose(timefp);
+ 	}
+ #endif /* TIMELOG */
  	printf("id      name   race    class    align  score    talons military  civilians sect\n");
  	for (nationid=1; nationid<NTOTAL; nationid++) {
  		if(!isntn(ntn[nationid].active)) continue;
*** onewhelp.c
--- newhelp.c
**************
*** 160,165
  	fprintf(fp,"s/ZSTOCKCOST/%d/g\n",STOCKCOST);
  	
  	/* other defines */
  	fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
  	fprintf(fp,"s/XLANDSEE/%d/g\n",LANDSEE);
  	fprintf(fp,"s/XNAVYSEE/%d/g\n",NAVYSEE);
--- 160,166 -----
  	fprintf(fp,"s/ZSTOCKCOST/%d/g\n",STOCKCOST);
  	
  	/* other defines */
+ #ifdef RANEVENT
  	fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
  #else
  	fprintf(fp,"s/XNORANDEVENTS/0/g\n");
**************
*** 161,166
  	
  	/* other defines */
  	fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
  	fprintf(fp,"s/XLANDSEE/%d/g\n",LANDSEE);
  	fprintf(fp,"s/XNAVYSEE/%d/g\n",NAVYSEE);
  	fprintf(fp,"s/XARMYSEE/%d/g\n",ARMYSEE);
--- 162,170 -----
  	/* other defines */
  #ifdef RANEVENT
  	fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
+ #else
+ 	fprintf(fp,"s/XNORANDEVENTS/0/g\n");
+ #endif
  	fprintf(fp,"s/XLANDSEE/%d/g\n",LANDSEE);
  	fprintf(fp,"s/XNAVYSEE/%d/g\n",NAVYSEE);
  	fprintf(fp,"s/XARMYSEE/%d/g\n",ARMYSEE);
*** odata.c
--- data.c
**************
*** 181,186
  char	*exefile =  "exec";
  char	*datafile = "data";
  char	*msgfile =  "mesg";
  char	*sortname = "conqsort";
  
  #ifdef ADMIN
--- 181,187 -----
  char	*exefile =  "exec";
  char	*datafile = "data";
  char	*msgfile =  "mesg";
+ char *timefile = "timelog";
  char	*sortname = "conqsort";
  
  #ifdef ADMIN
*** omagic.c
--- magic.c
**************
*** 377,384
  	if(newpower==DESTROYER) {
  /* this ifdef is so that destroyer only takes place in an update */
  #ifdef ADMIN
! 		for(x=curntn->capx-3;x<=curntn->capx+3;x++) {
! 			for(y=curntn->capy-3;y<=curntn->capy+3;y++){
  				if((ONMAP(x,y))
  				&&(sct[x][y].altitude!=WATER)
  #ifdef DERVDESG
--- 377,384 -----
  	if(newpower==DESTROYER) {
  /* this ifdef is so that destroyer only takes place in an update */
  #ifdef ADMIN
! 		for(x=(int)curntn->capx-3;x<=(int)curntn->capx+3;x++) {
! 			for(y=(int)curntn->capy-3;y<=(int)curntn->capy+3;y++){
  				if((ONMAP(x,y))
  				&&(sct[x][y].altitude!=WATER)
  #ifdef DERVDESG
**************
*** 723,730
  		return;
  	}
  	if(oldpower==DESTROYER) {
! 		for(x=curntn->capx-3;x<=curntn->capx+3;x++) {
! 			for(y=curntn->capy-3;y<=curntn->capy+3;y++){
  				if((ONMAP(x,y))
  				&&(sct[x][y].altitude!=WATER)
  				&&((x!=curntn->capx)
--- 723,730 -----
  		return;
  	}
  	if(oldpower==DESTROYER) {
! 		for(x=(int)curntn->capx-3;x<=(int)curntn->capx+3;x++) {
! 			for(y=(int)curntn->capy-3;y<=(int)curntn->capy+3;y++){
  				if((ONMAP(x,y))
  				&&(sct[x][y].altitude!=WATER)
  				&&((x!=curntn->capx)
*** onewlogin.c
--- newlogin.c
**************
*** 504,510
  				printf("how many purchasing points to spend?:");
  				scanf("%d",&temp);
  				putchar('\n');
! 				if(temp < points) {
  					printf("You don't have enough points left");
  				} else if (temp < 0) {
  					printf("Negative, huh?  Who you trying to kid?");
--- 504,510 -----
  				printf("how many purchasing points to spend?:");
  				scanf("%d",&temp);
  				putchar('\n');
! 				if(temp > points) {
  					printf("You don't have enough points left");
  				} else if (temp < 0) {
  					printf("Negative, huh?  Who you trying to kid?");
**************
*** 792,798
  				&&( sct[i][j].owner!=0)) placed=0;
  				}
  			} else {
! 				if(MAPX>24){
  					x = rand()%(MAPX-24)+12;
  					y = rand()%(MAPY-24)+12;
  				}else {
--- 792,798 -----
  				&&( sct[i][j].owner!=0)) placed=0;
  				}
  			} else {
! 				if(MAPX>24 && MAPY>24){
  					x = rand()%(MAPX-24)+12;
  					y = rand()%(MAPY-24)+12;
  				}else {
*** odisplay.c
--- display.c
**************
*** 408,415
  
  	for(nvynum=0;nvynum<MAXNAVY;nvynum++)
  		if((P_NMSHP!=0)||(P_NWSHP!=0)||(P_NGSHP!=0))
! 		for(i=P_NXLOC-xoffset-NAVYSEE;i<=P_NXLOC-xoffset+NAVYSEE;i++)
! 		for(j=P_NYLOC-yoffset-NAVYSEE;j<=P_NYLOC-yoffset+NAVYSEE;j++)
  		if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
  			HAS_SEEN(i,j)=TRUE;
  
--- 408,415 -----
  
  	for(nvynum=0;nvynum<MAXNAVY;nvynum++)
  		if((P_NMSHP!=0)||(P_NWSHP!=0)||(P_NGSHP!=0))
! 		for(i=(int)P_NXLOC-xoffset-NAVYSEE;i<=(int)P_NXLOC-xoffset+NAVYSEE;i++)
! 		for(j=(int)P_NYLOC-yoffset-NAVYSEE;j<=(int)P_NYLOC-yoffset+NAVYSEE;j++)
  		if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
  			HAS_SEEN(i,j)=TRUE;
  
**************
*** 415,422
  
  	for(armynum=0;armynum<MAXARM;armynum++)
  		if(P_ASOLD>0)
! 		for(i=P_AXLOC-xoffset-ARMYSEE;i<=P_AXLOC-xoffset+ARMYSEE;i++)
! 		for(j=P_AYLOC-yoffset-ARMYSEE;j<=P_AYLOC-yoffset+ARMYSEE;j++)
  		if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
  			HAS_SEEN(i,j)=TRUE;
  
--- 415,422 -----
  
  	for(armynum=0;armynum<MAXARM;armynum++)
  		if(P_ASOLD>0)
! 		for(i=(int)P_AXLOC-xoffset-ARMYSEE;i<=(int)P_AXLOC-xoffset+ARMYSEE;i++)
! 		for(j=(int)P_AYLOC-yoffset-ARMYSEE;j<=(int)P_AYLOC-yoffset+ARMYSEE;j++)
  		if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
  			HAS_SEEN(i,j)=TRUE;
  
*** omain.c
--- main.c
**************
*** 211,222
  	}
  
  	initscr();		/* SET UP THE SCREEN */
- 	copyscreen();		/* copyright screen */
- 				/* note the getch() later - everything between
- 					now and then is non-interactive */
- 	init_hasseen();		/* now we know how big the screen is, 
- 					we can init that array!	*/
- 
  	/* check terminal size */
  	if (COLS<80 || LINES<24) {
  		fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
--- 211,216 -----
  	}
  
  	initscr();		/* SET UP THE SCREEN */
  	/* check terminal size */
  	if (COLS<80 || LINES<24) {
  		fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
**************
*** 222,228
  		fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
  		fprintf(stderr,"please try again with a different setup\n");
  		beep();
- 		refresh();
  		getch();
  		bye(FALSE);
  	}
--- 216,221 -----
  		fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
  		fprintf(stderr,"please try again with a different setup\n");
  		beep();
  		getch();
  		bye(FALSE);
  	}
**************
*** 227,232
  		bye(FALSE);
  	}
  
  	strcpy(fison,"START");	/* just in case you abort early */
  	crmode();		/* cbreak mode */
  
--- 220,231 -----
  		bye(FALSE);
  	}
  
+ 	copyscreen();		/* copyright screen */
+ 				/* note the getch() later - everything between
+ 					now and then is non-interactive */
+ 	init_hasseen();		/* now we know how big the screen is, 
+ 					we can init that array!	*/
+ 
  	strcpy(fison,"START");	/* just in case you abort early */
  	crmode();		/* cbreak mode */
  
**************
*** 263,269
  #endif TRADE
  		if(curntn->capx>15) {
  			xcurs=15;
! 			xoffset= (curntn->capx-15);
  		} else {
  			xcurs= curntn->capx;
  			xoffset= 0;
--- 262,268 -----
  #endif TRADE
  		if(curntn->capx>15) {
  			xcurs=15;
! 			xoffset= ((int)curntn->capx-15);
  		} else {
  			xcurs= curntn->capx;
  			xoffset= 0;
**************
*** 270,276
  		}
  		if(curntn->capy>10) {
  			ycurs=10;
! 			yoffset= (curntn->capy-10);
  		} else {
  			yoffset= 0;
  			ycurs= curntn->capy;
--- 269,275 -----
  		}
  		if(curntn->capy>10) {
  			ycurs=10;
! 			yoffset= ((int)curntn->capy-10);
  		} else {
  			yoffset= 0;
  			ycurs= curntn->capy;
**************
*** 692,698
  		} else {
  			if(curntn->capx>15) {
  				xcurs=15;
! 				xoffset= (curntn->capx-15);
  			} else {
  				xcurs= curntn->capx;
  				xoffset= 0;
--- 691,697 -----
  		} else {
  			if(curntn->capx>15) {
  				xcurs=15;
! 				xoffset= ((int)curntn->capx-15);
  			} else {
  				xcurs= curntn->capx;
  				xoffset= 0;
**************
*** 699,705
  			}
  			if(curntn->capy>10) {
  				ycurs=10;
! 				yoffset= (curntn->capy-10);
  			} else {
  				yoffset= 0;
  				ycurs= curntn->capy;
--- 698,704 -----
  			}
  			if(curntn->capy>10) {
  				ycurs=10;
! 				yoffset= ((int)curntn->capy-10);
  			} else {
  				yoffset= 0;
  				ycurs= curntn->capy;
**************
*** 1012,1017
  void
  copyscreen()
  {
  	clear();
  	standout();
  	mvprintw(8,28,"Conquer %s.%d",VERSION,PATCHLEVEL);
--- 1011,1021 -----
  void
  copyscreen()
  {
+ #ifdef TIMELOG
+ 	FILE *timefp, *fopen();
+ 	char string[80];
+ #endif /* TIMELOG */
+ 
  	clear();
  	standout();
  	mvprintw(8,COLS/2-12,"Conquer %s.%d",VERSION,PATCHLEVEL);
**************
*** 1014,1020
  {
  	clear();
  	standout();
! 	mvprintw(8,28,"Conquer %s.%d",VERSION,PATCHLEVEL);
  	standend();
  	mvaddstr(10,19, "Copyright (c) 1988 by Edward M Barlow");
  	mvaddstr(11,18,"Written Edward M Barlow and Adam Bryant");
--- 1018,1024 -----
  
  	clear();
  	standout();
! 	mvprintw(8,COLS/2-12,"Conquer %s.%d",VERSION,PATCHLEVEL);
  	standend();
  	mvaddstr(10,COLS/2-21, "Copyright (c) 1988 by Edward M Barlow");
  	mvaddstr(11,COLS/2-22,"Written Edward M Barlow and Adam Bryant");
**************
*** 1016,1029
  	standout();
  	mvprintw(8,28,"Conquer %s.%d",VERSION,PATCHLEVEL);
  	standend();
! 	mvaddstr(10,19, "Copyright (c) 1988 by Edward M Barlow");
! 	mvaddstr(11,18,"Written Edward M Barlow and Adam Bryant");
! 	mvaddstr(12,26,"All Rights Reserved");
! 	mvaddstr(LINES-7,19,"This version is for personal use only");
! 	mvaddstr(LINES-5,8,"It is expressly forbidden port this software to any form of");
! 	mvaddstr(LINES-4,8,"Personal Computer or to redistribute this software without");
! 	mvaddstr(LINES-3,14,"the permission of Edward Barlow or Adam Bryant");
! 	mvprintw(LINES-1, 60, "PRESS ANY KEY");
  	refresh();
  }
  
--- 1020,1040 -----
  	standout();
  	mvprintw(8,COLS/2-12,"Conquer %s.%d",VERSION,PATCHLEVEL);
  	standend();
! 	mvaddstr(10,COLS/2-21, "Copyright (c) 1988 by Edward M Barlow");
! 	mvaddstr(11,COLS/2-22,"Written Edward M Barlow and Adam Bryant");
! 	mvaddstr(12,COLS/2-12,"All Rights Reserved");
! 	mvaddstr(LINES-8,COLS/2-21,"This version is for personal use only");
! 	mvaddstr(LINES-6,COLS/2-32,"It is expressly forbidden port this software to any form of");
! 	mvaddstr(LINES-5,COLS/2-32,"Personal Computer or to redistribute this software without");
! 	mvaddstr(LINES-4,COLS/2-26,"the permission of Edward Barlow or Adam Bryant");
! #ifdef TIMELOG
! 	if ((timefp=fopen(timefile,"r"))!=NULL) {
! 		fgets(string, 50, timefp);
! 		mvprintw(LINES-1, 0, "Last Update: %s", string);
! 		fclose(timefp);
! 	}
! #endif /* TIMELOG */
! 	mvprintw(LINES-1, COLS-20, "PRESS ANY KEY");
  	refresh();
  }
  
*** onpc.c
--- npc.c
**************
*** 29,35
  	int x,y;
  /*	FOR TESTING OF WHAT THE ATTRACTIVENESS ENDS UP LIKE  */
  	printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
! 	for(y=curntn->capy-3;y<curntn->capy+4;y++) {
  		printf("\n");
  		for(x=curntn->capx-3;x<curntn->capx+4;x++) if(ONMAP(x,y)) {
  			if( sct[x][y].altitude != WATER ) {
--- 29,35 -----
  	int x,y;
  /*	FOR TESTING OF WHAT THE ATTRACTIVENESS ENDS UP LIKE  */
  	printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
! 	for(y=(int)curntn->capy-3;y<(int)curntn->capy+4;y++) {
  		printf("\n");
  		for(x=(int)curntn->capx-3;x<(int)curntn->capx+4;x++) if(ONMAP(x,y)) {
  			if( sct[x][y].altitude != WATER ) {
**************
*** 31,37
  	printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
  	for(y=curntn->capy-3;y<curntn->capy+4;y++) {
  		printf("\n");
! 		for(x=curntn->capx-3;x<curntn->capx+4;x++) if(ONMAP(x,y)) {
  			if( sct[x][y].altitude != WATER ) {
  				printf("[%2d,%2d]   ",x,y);
  			}
--- 31,37 -----
  	printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
  	for(y=(int)curntn->capy-3;y<(int)curntn->capy+4;y++) {
  		printf("\n");
! 		for(x=(int)curntn->capx-3;x<(int)curntn->capx+4;x++) if(ONMAP(x,y)) {
  			if( sct[x][y].altitude != WATER ) {
  				printf("[%2d,%2d]   ",x,y);
  			}
**************
*** 37,43
  			}
  		}
  		printf("\n");
! 		for(x=curntn->capx-3;x<curntn->capx+4;x++) if(ONMAP(x,y)) {
  			if( sct[x][y].altitude != WATER ) {
  				printf("%5d %c%c%c "
  					,attr[x][y]
--- 37,43 -----
  			}
  		}
  		printf("\n");
! 		for(x=(int)curntn->capx-3;x<(int)curntn->capx+4;x++) if(ONMAP(x,y)) {
  			if( sct[x][y].altitude != WATER ) {
  				printf("%5d %c%c%c "
  					,attr[x][y]
**************
*** 111,118
  		}
  		count=0;
  		while( TRUE ) {
! 			x=P_AXLOC+rand()%5-2;
! 			y=P_AYLOC+rand()%5-2;
  
  			if( count++ > 100 ) {
  				P_ASOLD=0;
--- 111,118 -----
  		}
  		count=0;
  		while( TRUE ) {
! 			x=(int)P_AXLOC+rand()%5-2;
! 			y=(int)P_AYLOC+rand()%5-2;
  
  			if( count++ > 100 ) {
  				P_ASOLD=0;
**************
*** 122,128
  			if(( x==P_AXLOC && y==P_AYLOC )
  			||(!ONMAP(x,y)
  			||(!is_habitable(x,y))) 
! 			||(!land_reachp(P_AXLOC,P_AYLOC,x,y,curntn->maxmove,country))) continue;
  
  			P_AXLOC=x;
  			P_AYLOC=y;
--- 122,129 -----
  			if(( x==P_AXLOC && y==P_AYLOC )
  			||(!ONMAP(x,y)
  			||(!is_habitable(x,y))) 
! 			||(!land_reachp((int)P_AXLOC,(int)P_AYLOC,
! 				x,y,curntn->maxmove,country))) continue;
  
  			P_AXLOC=x;
  			P_AYLOC=y;
**************
*** 167,174
  			P_ASOLD /= 100;
  		}
  		P_AMOVE=(curntn->maxmove * *(unitmove+P_ATYPE%UTYPE))/10;
! 		x=P_AXLOC+rand()%2-1;
! 		y=P_AYLOC+rand()%2-1;
  		if(ONMAP(x,y)&&(is_habitable(x,y)) 
  		&&(land_reachp(P_AXLOC,P_AYLOC,x,y,P_AMOVE,country))){
  			P_AXLOC=x;
--- 168,175 -----
  			P_ASOLD /= 100;
  		}
  		P_AMOVE=(curntn->maxmove * *(unitmove+P_ATYPE%UTYPE))/10;
! 		x=(int)P_AXLOC+rand()%3-1;
! 		y=(int)P_AYLOC+rand()%3-1;
  		if(ONMAP(x,y)&&(is_habitable(x,y)) 
  		&&(land_reachp((int)P_AXLOC,(int)P_AYLOC,x,y,P_AMOVE,country))){
  			P_AXLOC=x;
**************
*** 170,176
  		x=P_AXLOC+rand()%2-1;
  		y=P_AYLOC+rand()%2-1;
  		if(ONMAP(x,y)&&(is_habitable(x,y)) 
! 		&&(land_reachp(P_AXLOC,P_AYLOC,x,y,P_AMOVE,country))){
  			P_AXLOC=x;
  			P_AYLOC=y;
  			/*if owned & unoccupied you take & people flee*/
--- 171,177 -----
  		x=(int)P_AXLOC+rand()%3-1;
  		y=(int)P_AYLOC+rand()%3-1;
  		if(ONMAP(x,y)&&(is_habitable(x,y)) 
! 		&&(land_reachp((int)P_AXLOC,(int)P_AYLOC,x,y,P_AMOVE,country))){
  			P_AXLOC=x;
  			P_AYLOC=y;
  			/*if owned & unoccupied you take & people flee*/
**************
*** 244,251
  		for(y=0;y<MAXNAVY;y++)
  		if(ntn[x].nvy[y].warships!=0 || ntn[x].nvy[y].merchant!=0 
  		  || ntn[x].nvy[y].galleys!=0) {
! 			if((abs(ntn[x].nvy[y].xloc-P_NXLOC)<=PRTZONE)
! 			&&(abs(ntn[x].nvy[y].yloc-P_NYLOC)<=PRTZONE)) {
  				P_NXLOC= ntn[x].nvy[y].xloc;
  				P_NYLOC= ntn[x].nvy[y].yloc;
  			}
--- 245,252 -----
  		for(y=0;y<MAXNAVY;y++)
  		if(ntn[x].nvy[y].warships!=0 || ntn[x].nvy[y].merchant!=0 
  		  || ntn[x].nvy[y].galleys!=0) {
! 			if((abs((int)ntn[x].nvy[y].xloc-(int)P_NXLOC)<=PRTZONE)
! 			&&(abs((int)ntn[x].nvy[y].yloc-(int)P_NYLOC)<=PRTZONE)) {
  				P_NXLOC= ntn[x].nvy[y].xloc;
  				P_NYLOC= ntn[x].nvy[y].yloc;
  			}
**************
*** 359,366
  	for(armynum=1;armynum<MAXARM;armynum++) if(P_ASOLD>0){
  		/* move army back if too far out */
  		ok = 0;
! 		for(x=P_AXLOC-3;x<=P_AXLOC+3;x++)
! 			for(y=P_AYLOC-3;y<=P_AYLOC+3;y++)
  				if((ONMAP(x,y))&&(sct[x][y].owner==country)) ok=1;
  		if(ok==0){
  			P_AXLOC=curntn->capx;
--- 360,367 -----
  	for(armynum=1;armynum<MAXARM;armynum++) if(P_ASOLD>0){
  		/* move army back if too far out */
  		ok = 0;
! 		for(x=(int)P_AXLOC-3;x<=(int)P_AXLOC+3;x++)
! 			for(y=(int)P_AYLOC-3;y<=(int)P_AYLOC+3;y++)
  				if((ONMAP(x,y))&&(sct[x][y].owner==country)) ok=1;
  		if(ok==0){
  			P_AXLOC=curntn->capx;
**************
*** 727,734
  			hostile-=20;
  		}
  		/* if next to capitol, they dont like you */
! 		for(X=curntn->capx-1;X<=curntn->capx+1;X++)
! 		for(Y=curntn->capy-1;Y<=curntn->capy+1;Y++) if(ONMAP(X,Y)) {
  			if(sct[X][Y].owner == x) {
  				friendly-=10;
  				hostile +=10;
--- 728,736 -----
  			hostile-=20;
  		}
  		/* if next to capitol, they dont like you */
! 		for(X=(int)curntn->capx-1;X<=(int)curntn->capx+1;X++)
! 		for(Y=(int)curntn->capy-1;Y<=(int)curntn->capy+1;Y++)
! 		if(ONMAP(X,Y)) {
  			if(sct[X][Y].owner == x) {
  				friendly-=10;
  				hostile +=10;
**************
*** 840,846
  		endy=MAPY;
  	} else {
  		if( curntn->capx > NPCTOOFAR )
! 			stx=curntn->capx-NPCTOOFAR;
  		else	stx=0;
  		if( curntn->capy > NPCTOOFAR )
  			sty=curntn->capy-NPCTOOFAR;
--- 842,848 -----
  		endy=MAPY;
  	} else {
  		if( curntn->capx > NPCTOOFAR )
! 			stx=(int)curntn->capx-NPCTOOFAR;
  		else	stx=0;
  		if( curntn->capy > NPCTOOFAR )
  			sty=(int)curntn->capy-NPCTOOFAR;
**************
*** 843,849
  			stx=curntn->capx-NPCTOOFAR;
  		else	stx=0;
  		if( curntn->capy > NPCTOOFAR )
! 			sty=curntn->capy-NPCTOOFAR;
  		else	sty=0;
  		if( curntn->capx + NPCTOOFAR < MAPX )
  			endx=curntn->capx+NPCTOOFAR;
--- 845,851 -----
  			stx=(int)curntn->capx-NPCTOOFAR;
  		else	stx=0;
  		if( curntn->capy > NPCTOOFAR )
! 			sty=(int)curntn->capy-NPCTOOFAR;
  		else	sty=0;
  		if( (int)curntn->capx + NPCTOOFAR < MAPX )
  			endx=(int)curntn->capx+NPCTOOFAR;
**************
*** 845,852
  		if( curntn->capy > NPCTOOFAR )
  			sty=curntn->capy-NPCTOOFAR;
  		else	sty=0;
! 		if( curntn->capx + NPCTOOFAR < MAPX )
! 			endx=curntn->capx+NPCTOOFAR;
  		else	endx=MAPX;
  		if( curntn->capy + NPCTOOFAR < MAPY )
  			endy=curntn->capy+NPCTOOFAR;
--- 847,854 -----
  		if( curntn->capy > NPCTOOFAR )
  			sty=(int)curntn->capy-NPCTOOFAR;
  		else	sty=0;
! 		if( (int)curntn->capx + NPCTOOFAR < MAPX )
! 			endx=(int)curntn->capx+NPCTOOFAR;
  		else	endx=MAPX;
  		if( (int)curntn->capy + NPCTOOFAR < MAPY )
  			endy=(int)curntn->capy+NPCTOOFAR;
**************
*** 848,855
  		if( curntn->capx + NPCTOOFAR < MAPX )
  			endx=curntn->capx+NPCTOOFAR;
  		else	endx=MAPX;
! 		if( curntn->capy + NPCTOOFAR < MAPY )
! 			endy=curntn->capy+NPCTOOFAR;
  		else	endy=MAPY;
  	}
  
--- 850,857 -----
  		if( (int)curntn->capx + NPCTOOFAR < MAPX )
  			endx=(int)curntn->capx+NPCTOOFAR;
  		else	endx=MAPX;
! 		if( (int)curntn->capy + NPCTOOFAR < MAPY )
! 			endy=(int)curntn->capy+NPCTOOFAR;
  		else	endy=MAPY;
  	}
  
**************
*** 1099,1106
  	for(x=stx;x<endx;x++) for(y=sty;y<endy;y++)  {
  		if((sct[x][y].owner != country )
  		&&( sct[x][y].owner != 0 )
! 		&&( abs(x-curntn->capx)>2 )
! 		&&( abs(y-curntn->capy)>2 )
  		&&( ntn[country].dstatus[sct[x][y].owner]<WAR)
  		&&( ntn[sct[x][y].owner].dstatus[country]<WAR)
  		&&( ntn[country].dstatus[sct[x][y].owner]>ALLIED))
--- 1101,1108 -----
  	for(x=stx;x<endx;x++) for(y=sty;y<endy;y++)  {
  		if((sct[x][y].owner != country )
  		&&( sct[x][y].owner != 0 )
! 		&&( abs(x-(int)curntn->capx)>2 )
! 		&&( abs(y-(int)curntn->capy)>2 )
  		&&( ntn[country].dstatus[sct[x][y].owner]<WAR)
  		&&( ntn[sct[x][y].owner].dstatus[country]<WAR)
  		&&( ntn[country].dstatus[sct[x][y].owner]>ALLIED))
**************
*** 1126,1133
  	register int x,y;
  
  	/* around capitol */
! 	for(x=curntn->capx-4;x<=curntn->capx+4;x++){
! 		for(y=curntn->capy-4;y<=curntn->capy+4;y++){
  			if((ONMAP(x,y))&&(sct[x][y].owner==0)) {
  				attr[x][y] += 700;
  			}
--- 1128,1135 -----
  	register int x,y;
  
  	/* around capitol */
! 	for(x=(int)curntn->capx-4;x<=(int)curntn->capx+4;x++){
! 		for(y=(int)curntn->capy-4;y<=(int)curntn->capy+4;y++){
  			if((ONMAP(x,y))&&(sct[x][y].owner==0)) {
  				attr[x][y] += 700;
  			}
**************
*** 1167,1174
  				ntn[natn].arm[x].sold/10;
  
  	/*plus 80 if near your capitol */
! 	for(x=curntn->capx-1;x<=curntn->capy+1;x++){
! 		for(y=curntn->capy-1;y<=curntn->capy+1;y++){
  			if(ONMAP(x,y)) attr[x][y]+=80;
  		}
  	}
--- 1169,1176 -----
  				ntn[natn].arm[x].sold/10;
  
  	/*plus 80 if near your capitol */
! 	for(x=(int)curntn->capx-1;x<=(int)curntn->capy+1;x++){
! 		for(y=(int)curntn->capy-1;y<=(int)curntn->capy+1;y++){
  			if(ONMAP(x,y)) attr[x][y]+=80;
  		}
  	}