[comp.sources.games] v07i053: conquer4 - middle earth multi-player game

billr@saab.CNA.TEK.COM (Bill Randle) (07/20/89)

Submitted-by: Adam Bryant <adb@bu-cs.bu.edu>
Posting-number: Volume 7, Issue 53
Archive-name: conquer4/Patch3b
Patch-To: conquer4: Volume 6, Issue 83-97



#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file oMakefile continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> oMakefile
X	$(CC) $(CFLAGS) -DADMIN -c data.c
X	mv data.o dataA.o
Xdisplay.o:	data.h header.h display.c
X	$(CC) $(CFLAGS) -DCONQUER -c display.c
Xreports.o:	data.h header.h reports.c
X	$(CC) $(CFLAGS) -DCONQUER -c reports.c
Xmove.o:	data.h header.h move.c
X	$(CC) $(CFLAGS) -DCONQUER -c move.c
Xmain.o:	data.h header.h main.c
X	$(CC) $(CFLAGS) -DCONQUER -c main.c
Xforms.o:	data.h header.h forms.c
X	$(CC) $(CFLAGS) -DCONQUER -c forms.c
Xcommands.o:	data.h header.h commands.c
X	$(CC) $(CFLAGS) -DCONQUER -c commands.c
Xcheck.o:	data.h header.h check.c
X	$(CC) $(CFLAGS) -c check.c
Xtrade.o:	data.h header.h trade.c
X	$(CC) $(CFLAGS) -DCONQUER -c trade.c
XtradeA.o:	data.h header.h trade.c
X	$(CC) $(CFLAGS) -DADMIN -c trade.c
X	mv trade.o tradeA.o
XnavyA.o:	data.h header.h navy.c
X	$(CC) $(CFLAGS) -DADMIN -c navy.c
X	mv navy.o navyA.o
Xnavy.o:	data.h header.h trade.c
X	$(CC) $(CFLAGS) -DCONQUER -c navy.c
Xnewhelp:	data.o header.h data.h newhelp.c
X	@echo Compiling the help program
X	$(CC) $(CFLAGS) newhelp.c data.o -o newhelp
SHAR_EOF
chmod 0644 oMakefile || echo "restore of oMakefile fails"
sed 's/^X//' << 'SHAR_EOF' > patchV4.03 &&
X*** opatchlevel.h	Tue Jul 18 22:04:44 1989
X--- patchlevel.h	Tue Jul 18 22:04:54 1989
X***************
X*** 1 ****
X! #define PATCHLEVEL	2
X--- 1 ----
X! #define PATCHLEVEL	3
X*** onotes.v4	Tue Jul 18 22:04:43 1989
X--- notes.v4	Tue Jul 18 22:04:54 1989
X***************
X*** 1,10 ****
X  ------------------------------------------------------------------------------
X  | THIS FILE CONTAINS RELEASE NOTES FOR CONQUER V4.0 			     |
X  | It is broken into 3 sections.  Section 3 reflects changes from v3.5 to v4. |
X! | Section 1 reflects bugs in v4.0.  Section 2 reflects. Future ideas.        |
X  ------------------------------------------------------------------------------
X  -------------------------------------------------------------------------
X! | == Bugs Fixed From Conquer Version 4.0 ============================== |
X  -------------------------------------------------------------------------
X    1. increased newstring[] array from 40 to 100 in makeworl.c.
X    2. corrected a mispelling of irrigation.
X--- 1,10 ----
X  ------------------------------------------------------------------------------
X  | THIS FILE CONTAINS RELEASE NOTES FOR CONQUER V4.0 			     |
X  | It is broken into 3 sections.  Section 3 reflects changes from v3.5 to v4. |
X! | Section 1 reflects bugs in v4.0.  Section 2 reflects future ideas.         |
X  ------------------------------------------------------------------------------
X  -------------------------------------------------------------------------
X! | 1.0 == Bugs Fixed From Conquer Version 4.0 ========================== |
X  -------------------------------------------------------------------------
X    1. increased newstring[] array from 40 to 100 in makeworl.c.
X    2. corrected a mispelling of irrigation.
X***************
X*** 40,48 ****
X   27. added more names to rebel name list.
X   28. worked on Makefile.  [made sure of parallelism; ready to distribute]
X   29. reworded treasury display on budget screen for clarity.
X  
X  -------------------------------------------------------------------------
X! | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4		|
X  -------------------------------------------------------------------------
X  o make land capture only occur during update.
X  o make the create world routine interactive with curses display.
X--- 40,110 ----
X   27. added more names to rebel name list.
X   28. worked on Makefile.  [made sure of parallelism; ready to distribute]
X   29. reworded treasury display on budget screen for clarity.
X+ ===4.0 patch number two released => 4.2 ==========================
X+  30. worked more on Makefile.  trying to fix others problems with .SUFFIXES.
X+  31. line 142 of commands.c:  fixed bug with assignment of designation.
X+  32. main.c: added environment variable CONQ_NATION.  overridden by '-n'.
X+  33. main.c: added environment variable CONQ_DATA. overridden by '-d'.
X+  34. patch to magic.c to extend printable user magics.  [Bob Earl].
X+  35. added BIGLTH, and FILELTH character string size constants.
X+  36. made NPC a number as with MONSTER.
X+  37. added new option '-G' for gaudy news country highlights.  [T. Kivinen].
X+  38. fixed bug with clearing WAR declarations in destroy. [T. Kivinen].
X+  39. Added a CONQ_OPTS environment variable... can contain many options.
X+ 	Format:   setenv CONQ_OPTS "G,nation=foo,data=1"
X+ 	so far only G (Gaudy News), nation, and data supported, may now
X+ 	remove the redundant CONQ_NATION, CONQ_DATA.
X+  40. patched newlogin.c to fix check of new nation name [Bob Earl].
X+  41. added LOCKF portion to FILELOCK for NFS systems [Richard Caley].
X+  42. added routine to print designations with '-p' [Richard Caley].
X+  43. added variations on 'data' or 'nation' to CONQ_OPTS (ex. 'name').
X+  44. NEAT NEW FEATURE!  DEMI-GOD! Now, ntn[0].leader holds the login name
X+ 	of a user who has update and god priveledge on that data file.
X+ 	It is set during world creation and changable from the 'c' command
X+ 	during the game.  ['c' for nation '0' to view name].
X+ 	This allows people to run their own games without owning conquer.
X+  45. Neatened the nation mark selection display in newlogin.c.
X+  46. Decided to remove default setting of nation mark.... always ask now.
X+  47. Fixed bugs in newlogin: 'points <= 0' where it should be 'temp <= 0'.
X+  48. Shortened name of monsters to 7 characters to prevent screen wrap.
X+  49. newlogin.c (916): decreased amount allocated for population dispersal.
X+  50. added command to select prior unit ['o'] like 'p' [Kianush Sayah-Karadji].
X+  51. extcmds.c (174,178) fix to allow switching out of march.  [Kevin Murray].
X+  52. added a #define XENIX for some XENIX 386 specific bugs. [Jonathan Bayer].
X+  53. reworked the make new_game in the Makefile.
X+  54. fixed the calculation of available nations in the campaign info screen.
X+  55. made slight adjustment to required wealth for gold mines.
X+  56. big redo on the Makefile.  hopefully this is now static.
X+  57. completed change of Barbarians to Savages.  Only makeworl.c vars now.
X+  58. removed the CONQ_DATA and CONQ_NATION environment variables since
X+ 	the CONQ_OPTS covers them and can even be expanded more later.
X+  59. big revamp of the helpfiles.  caught a few errors.
X+  60. added ntn[0].leader to the 'please contact' messages in admin and main.
X+  61. added monsters and peasants to the '-s' display.  [Doesn't show size].
X+  62. changed get_number() to return -1 for no input... fixed all occurances.
X+  63. reinstated ship and food trading.  NOTE!!! Nothing has really been
X+ 	done to fix it... use at own risk.  Perhaps someone will find the
X+ 	bugs and fix them. [these trading routines are only temp anyway.]
X+  64. added CONQ_OPTS to admin.c, ignore everything but "datadir=".
X+  65. spent ENTIRE weekend and rewrote newlogin.c.  NEW NEWLOGIN HAS:
X+ 	- curses screen interface.
X+ 	- entire input is character by character.
X+ 	- nice sliding arrow menu selection for final menu.
X+ 	- may add or subtract from final menu.
X+ 	- information on each selection is available via '?'.
X+ 	- move up and down via 'hjkl', 'DEL', or 'RET'.
X+ 	- in order to weaken orc population a little, set max repro.
X+ 	  during nation build to 12.  [May still reach 14 through magic].
X+ 	- almost all selections are handled in the same manor, this.
X+ 	  allows for easier debugging and better code.
X+ 	- the following routines will be available for a future makeworld.
X+ 	  interface:  newinit(), newbye(), newmsg(), newerror(), newreset().
X+  66. rewrote all routines that were called during a newlogin so that print
X+ 	statments use the newerror() or newmsg() interface.
X+ ===4.0 patch number three released => 4.3 ==========================
X  
X  -------------------------------------------------------------------------
X! | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4             |
X  -------------------------------------------------------------------------
X  o make land capture only occur during update.
X  o make the create world routine interactive with curses display.
X***************
X*** 66,72 ****
X  o provide a way for displaying monster nations properly... must also assure
X  	accurate information in tmil and tciv.
X  --------------------------------------------------------------------------
X! | 2) The Following are Good Ideas, But are not going to be done soon	 |
X  --------------------------------------------------------------------------
X  o Ruling leaders can ruthlesly supress revolts... 
X  
X--- 128,134 ----
X  o provide a way for displaying monster nations properly... must also assure
X  	accurate information in tmil and tciv.
X  --------------------------------------------------------------------------
X! | 2.5 The Following are Good Ideas, But are not going to be done soon	 |
X  --------------------------------------------------------------------------
X  o Ruling leaders can ruthlesly supress revolts... 
X  
X***************
X*** 180,186 ****
X  	percent less).  
X  
X  -----------------------------------------------------------------
X! | 3) Release notes for V4.0.  Changes from v3.5			|
X  -----------------------------------------------------------------
X  1) gave god NINJA power to see troops on the map
X  2) fixed message bug (printed blanks).
X--- 242,248 ----
X  	percent less).  
X  
X  -----------------------------------------------------------------
X! | 3.0 Release notes for V4.0.  Changes from v3.5		|
X  -----------------------------------------------------------------
X  1) gave god NINJA power to see troops on the map
X  2) fixed message bug (printed blanks).
X*** header.h.orig	Wed Jul 12 06:47:18 1989
X--- header.h	Wed Jul 19 10:48:54 1989
X***************
X*** 42,54 ****
X  #define SYSV		/* uncomment this line on a UNIX SYSV machine	*/
X  /* #define BSD		/* uncomment this line on a BSD machine		*/
X  /* #define HPUX		/* uncomment for HP-UNIX			*/
X  /* #define SYSMAIL	/* if your system supports mail			*/
X  			/* conquer will notify you about system mail	*/
X  
X! /* -------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING-------------	*/
X  #define SPOOLDIR "/usr/spool/mail"	/* location of mail spool	*/
X  /* #define FILELOCK	/* if your system supports BSD flock()		*/
X  			/* other file locking is not well implemented	*/
X  #define TIMELOG	/* if your system has the date command		*/
X  
X  #define NTOTAL 25	/* max # of nations ( player + npc + monster )	*/
X--- 42,56 ----
X  #define SYSV		/* uncomment this line on a UNIX SYSV machine	*/
X  /* #define BSD		/* uncomment this line on a BSD machine		*/
X  /* #define HPUX		/* uncomment for HP-UNIX			*/
X+ /*#define XENIX               /* this plus SYSV for XENIX machines, untested  */
X  /* #define SYSMAIL	/* if your system supports mail			*/
X  			/* conquer will notify you about system mail	*/
X  
X! /* -------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING-----------*/
X  #define SPOOLDIR "/usr/spool/mail"	/* location of mail spool	*/
X  /* #define FILELOCK	/* if your system supports BSD flock()		*/
X  			/* other file locking is not well implemented	*/
X+ /*#define LOCKF               /* in addition to FILELOCK if you have lockf    */
X  #define TIMELOG	/* if your system has the date command		*/
X  
X  #define NTOTAL 25	/* max # of nations ( player + npc + monster )	*/
X***************
X*** 66,79 ****
X  #define JEWELPCT 33	/* percent of tradegoods that are luxury items	*/
X  #define HIDELOC		/* defined if news is not to report sectors	*/
X  
X! #define OGOD		/* defined if you wish to enhance god powers.  This
X! 			   should not be defined on the pc as there is no
X! 			   /etc/passwd file to read info from		*/
X  
X  #define DERVDESG	/* allow DERVISH to redesignate in a DESERT/ICE	*/
X! #define MONSTER	45	/* defined if pirates/barbarians/nomads/lzard exist.
X  			   represents # of sectors of land that need to be
X! 			   in world per pirate/barbarian/nomad nation	*/
X  #define CHEAT		/* npcs will cheat to keep up - this is a very weak
X  			   form of cheating.  I use good npc algorithms 
X  			   (i think... comments)			*/
X--- 68,82 ----
X  #define JEWELPCT 33	/* percent of tradegoods that are luxury items	*/
X  #define HIDELOC		/* defined if news is not to report sectors	*/
X  
X! #define OGOD		/* defined if you wish to enhance god powers.   */
X  
X  #define DERVDESG	/* allow DERVISH to redesignate in a DESERT/ICE	*/
X! #define MONSTER	45	/* defined if pirates/savages/nomads/lzard exist.
X  			   represents # of sectors of land that need to be
X! 			   in world per pirate/savage/nomad nation	*/
X! #define NPC	45	/* defined if NPC nations should exist. The numeric
X! 			   represents # of sectors of land that need to be
X! 			   in world per non-player character nation	*/
X  #define CHEAT		/* npcs will cheat to keep up - this is a very weak
X  			   form of cheating.  I use good npc algorithms 
X  			   (i think... comments)			*/
X***************
X*** 87,94 ****
X  #define PMOUNT 40	/* % of land that is mountains			*/
X  #define PSTORM 3	/* % chance that a storm will strike a fleet	*/
X  			/* unless it is in harbor			*/
X! #define NPC		/* defined if non player country exists at start*/
X! #define CMOVE		/* Defined if you wish the computer to move
X  			   for Player nations if they forget to move	*/
X  #define BEEP		/* defined if you wish terminal to beep		*/
X  #define HILIGHT		/* defined if terminals support inverse video	*/
X--- 90,96 ----
X  #define PMOUNT 40	/* % of land that is mountains			*/
X  #define PSTORM 3	/* % chance that a storm will strike a fleet	*/
X  			/* unless it is in harbor			*/
X! #define CMOVE		/* #ifdef NPC; defined for the computer to move
X  			   for Player nations if they forget to move	*/
X  #define BEEP		/* defined if you wish terminal to beep		*/
X  #define HILIGHT		/* defined if terminals support inverse video	*/
X***************
X*** 100,106 ****
X  			/* a turn is 1 season and 25% is a large value	*/
X  #define	SPEW		/* spew random messages from npcs 		*/
X  
X! /* ---BELOW THIS POINT ARE PARAMETERS YOU MIGHT OPTIONALLY WISH TO CHANGE---	*/
X  
X  /* making these numbers large takes more CPU time			*/
X  #define LANDSEE 2	/* how far you can see from your land		*/
X--- 102,108 ----
X  			/* a turn is 1 season and 25% is a large value	*/
X  #define	SPEW		/* spew random messages from npcs 		*/
X  
X! /* -BELOW THIS POINT ARE PARAMETERS YOU MIGHT OPTIONALLY WISH TO CHANGE-*/
X  
X  /* making these numbers large takes more CPU time			*/
X  #define LANDSEE 2	/* how far you can see from your land		*/
X*** odata.h	Tue Jul 18 22:04:40 1989
X--- data.h	Tue Jul 18 22:04:55 1989
X***************
X*** 21,31 ****
X  #define	SCREEN_X_SIZE	(( COLS - 21) / 2)	/* divide by two as only 1/2 
X  						   sectors will be shown */
X  #define	SCREEN_Y_SIZE	( LINES - 5 )
X! #define HAS_SEEN(x,y)	hasseen[(x)+((y)*((COLS-10)/2))]
X! #define	PASSLTH		7	/*one less than the characters in the password*/
X! #define	NAMELTH		9	/*one less than the characters in the name*/
X! #define	LEADERLTH	9	/*one less than the characters in the leader*/
X  
X  /*simple contour map definitions*/
X  #define	WATER		(*(ele+0))
X  #define	PEAK		(*(ele+1))
X--- 21,38 ----
X  #define	SCREEN_X_SIZE	(( COLS - 21) / 2)	/* divide by two as only 1/2 
X  						   sectors will be shown */
X  #define	SCREEN_Y_SIZE	( LINES - 5 )
X! #define	HAS_SEEN(x,y)	hasseen[(x)+((y)*((COLS-10)/2))]
X! #define	PASSLTH		7	/* the number of characters in the passwd*/
X! #define	NAMELTH		9	/* the number of characters in the name*/
X! #define	LEADERLTH	9	/* the number of characters in the leader*/
X! #define	FILELTH		80	/*length for filename holders*/
X! #define	LINELTH		80	/*length for input string lines*/
X! #define	BIGLTH		256	/*length for large storage strings*/
X! #define	NUMCLASS	11	/*number of nation classes */
X  
X+ /* environment variable strings to check */
X+ #define	ENVIRON_OPTS	"CONQ_OPTS"
X+ 
X  /*simple contour map definitions*/
X  #define	WATER		(*(ele+0))
X  #define	PEAK		(*(ele+1))
X***************
X*** 41,47 ****
X  #define	LIZARD		'L'
X  #define	HUMAN		'H'
X  #define	PIRATE		'P'
X! #define	BARBARIAN	'B'
X  #define	NOMAD		'N'
X  #define	TUNKNOWN	'?'
X  
X--- 48,54 ----
X  #define	LIZARD		'L'
X  #define	HUMAN		'H'
X  #define	PIRATE		'P'
X! #define	SAVAGE		'S'
X  #define	NOMAD		'N'
X  #define	TUNKNOWN	'?'
X  
X***************
X*** 236,242 ****
X  #define NPC_PIRATE	18
X  #define NPC_LIZARD	19
X  #define NPC_NOMAD	20
X! #define NPC_BARBARIAN	21
X  
X  #define	ispc(x)		(((x)==PC_GOOD)||((x)==PC_EVIL)||((x)==PC_NEUTRAL))
X  #define	npctype(x)	(ispc(x) ? (x) : (x)/4)
X--- 243,249 ----
X  #define NPC_PIRATE	18
X  #define NPC_LIZARD	19
X  #define NPC_NOMAD	20
X! #define NPC_SAVAGE	21
X  
X  #define	ispc(x)		(((x)==PC_GOOD)||((x)==PC_EVIL)||((x)==PC_NEUTRAL))
X  #define	npctype(x)	(ispc(x) ? (x) : (x)/4)
X***************
X*** 611,617 ****
X  extern int	fltghold(),fltwhold(),fltmhold(),flthold(),compass();
X  extern int	get_country(),check_lock(),doclass();
X  extern unsigned short	fltspeed();
X! extern void	do_pirate(), do_nomad(), do_barbarian(), do_lizard();
X  extern void	getjewel(),getmetal(),loadfleet(),removemgk(),exenewmgk();
X  extern struct	s_sector *rand_sector();
X  extern void	subgships(),submships(),subwships(),getspace(),sackem();
X--- 618,624 ----
X  extern int	fltghold(),fltwhold(),fltmhold(),flthold(),compass();
X  extern int	get_country(),check_lock(),doclass();
X  extern unsigned short	fltspeed();
X! extern void	do_pirate(), do_nomad(), do_savage(), do_lizard();
X  extern void	getjewel(),getmetal(),loadfleet(),removemgk(),exenewmgk();
X  extern struct	s_sector *rand_sector();
X  extern void	subgships(),submships(),subwships(),getspace(),sackem();
X***************
X*** 622,627 ****
X--- 629,635 ----
X  extern void	errormsg(), clear_bottom(), addgroup(),ext_cmd();
X  extern void	randomevent(), wdisaster(), weather(), deplete();
X  extern void	verify_ntn(), verify_sct(), verifydata(), prep();
X+ extern void	newbye(), newreset(), newmsg(), newerror(), newinit();
X  extern void	destroy(), updmove(), spreadsheet(), mailopen(), mailclose();
X  extern void	updexecs(), updcapture(), updsectors();
X  extern void	updmil(), updcomodities(), updleader();
X*** oadmin.c	Tue Jul 18 22:04:39 1989
X--- admin.c	Tue Jul 18 22:04:55 1989
X***************
X*** 46,53 ****
X  int argc;
X  char **argv;
X  {
X! 	int geteuid(), getuid(), setuid();
X! 	register int i;
X  	char *name;
X  	void srand();
X  	int getopt();
X--- 46,53 ----
X  int argc;
X  char **argv;
X  {
X! 	int geteuid(), getuid(), setuid(), realuser, l;
X! 	register int i,j;
X  	char *name;
X  	void srand();
X  	int getopt();
X***************
X*** 55,71 ****
X  	/* mflag = makeworld, a=add player, x=execute, p=print */
X  	/* rflag = make world from read in files */
X  	int mflag, aflag, xflag, pflag, rflag;
X! 	char string[80];
X  	extern char *optarg;
X! 	char defaultdir[256];
X  	struct passwd *getpwnam();
X  
X  	mflag = aflag = xflag = pflag = rflag = 0;
X  	srand((unsigned) time((long *) 0));
X! 	strcpy(defaultdir, DEFAULTDIR);
X  	name = string;
X  	*name = 0;
X  
X  	/* process the command line arguments */
X  	while((i=getopt(argc,argv,"maxpr:d:"))!=EOF) switch(i){
X  	/* process the command line arguments */
X--- 55,133 ----
X  	/* mflag = makeworld, a=add player, x=execute, p=print */
X  	/* rflag = make world from read in files */
X  	int mflag, aflag, xflag, pflag, rflag;
X! 	char string[FILELTH];
X  	extern char *optarg;
X! 	char defaultdir[BIGLTH],cq_opts[BIGLTH];
X  	struct passwd *getpwnam();
X  
X  	mflag = aflag = xflag = pflag = rflag = 0;
X  	srand((unsigned) time((long *) 0));
X! 	strcpy(cq_opts,"");
X  	name = string;
X  	*name = 0;
X  
X+ 	/* check conquer options */
X+ 	if (getenv(ENVIRON_OPTS)!=NULL) {
X+ 		strncpy(cq_opts, getenv(ENVIRON_OPTS), BIGLTH-1);
X+ 	}
X+ 	if (cq_opts[0] != '\0') {
X+ 		l = strlen(cq_opts);
X+ 		for(i=0; i<l; i++) {
X+ 			switch(cq_opts[i]) {
X+ 			case 'G':
X+ 				/* ignore Gaudy display */
X+ 				break;
X+ 			case 'N':
X+ 			case 'n':
X+ 				/* ignore nation name */
X+ 				for (;i<l && cq_opts[i]!=',';i++);
X+ 				break;
X+ 			case 'D':
X+ 			case 'd':
X+ 				/* check for data directory */
X+ 				if (strncmp(cq_opts+i+1,"ata=",4)==0) {
X+ 					i += 5;
X+ 				} else if (strncmp(cq_opts+i+1,"atadir=",7)==0) {
X+ 					i += 8;
X+ 				} else if (strncmp(cq_opts+i+1,"irectory=",9)==0) {
X+ 					i += 10;
X+ 				} else if (strncmp(cq_opts+i+1,"ir=",3)==0) {
X+ 					i += 4;
X+ 				} else {
X+ 					fprintf(stderr,"conquer: invalid environment\n");
X+ 					fprintf(stderr,"\t%s = %s\n",ENVIRON_OPTS,cq_opts);
X+ 					fprintf(stderr,"\texpected <data=NAME>\n");
X+ 					exit(FAIL);
X+ 				}
X+ 				if (i<l) {
X+ 					/* grab the data directory */
X+ 					for (j=0; j<l-i && cq_opts[i+j]!=',';j++) {
X+ 						defaultdir[j] = cq_opts[i+j];
X+ 					}
X+ 					defaultdir[j]='\0';
X+ 					i += j-1;
X+ 				}
X+ 				break;
X+ 			case ' ':
X+ 			case ',':
X+ 				/* ignore commas and spaces */
X+ 				break;
X+ 			default:
X+ 				/* complain */
X+ 				fprintf(stderr,"conquer: invalid environment\n");
X+ 				fprintf(stderr,"\t%s = %s\n",ENVIRON_OPTS,cq_opts);
X+ 				fprintf(stderr,"\tunexpected option <%c>\n",cq_opts[i]);
X+ 				exit(FAIL);
X+ 				break;
X+ 			}
X+ 	     }
X+ 	}
X+ 
X+ 	/* set the default data directory */
X+ 	if (defaultdir[0] == '\0') {
X+ 		strcpy(defaultdir, DEFAULTDIR);
X+ 	}
X+ 
X  	/* process the command line arguments */
X  	while((i=getopt(argc,argv,"maxpr:d:"))!=EOF) switch(i){
X  	/* process the command line arguments */
X***************
X*** 90,100 ****
X  		strcpy(scenario, optarg);
X  		break;
X  	case 'd':
X! 		if(optarg[0]!='/') {
X! 			sprintf(defaultdir, "%s/%s", DEFAULTDIR, optarg);
X! 		} else {
X! 			strcpy(defaultdir, optarg);
X! 		}
X  		break;
X  	case '?': /*  print out command line arguments */
X  		printf("Command line format: %s [-maxp -dDIR -rSCENARIO]\n",argv[0]);
X--- 152,158 ----
X  		strcpy(scenario, optarg);
X  		break;
X  	case 'd':
X! 		strcpy(defaultdir, optarg);
X  		break;
X  	case '?': /*  print out command line arguments */
X  		printf("Command line format: %s [-maxp -dDIR -rSCENARIO]\n",argv[0]);
X***************
X*** 107,123 ****
X  		exit(SUCCESS);
X  	};
X  
X! #ifdef OGOD
X! 	if(((getuid())!=(getpwnam(LOGIN)->pw_uid))&&(!aflag))
X! 	{
X! 	     printf("Sorry -- you can not administrate conquer\n");
X! 	     printf("you need to be logged in as %s\n",LOGIN);
X! 	     exit(FAIL);
X! 	}
X  	/* may now replace user identity */
X  	(void) setuid (geteuid ()) ;
X- #endif OGOD
X  
X  	/* now that we have parsed the args, we can got to the
X  	 * dir where the files are kept and do some work.
X  	 */
X--- 165,180 ----
X  		exit(SUCCESS);
X  	};
X  
X! 	realuser = getuid();
X  	/* may now replace user identity */
X  	(void) setuid (geteuid ()) ;
X  
X+ 	/* set proper defaultdir */
X+ 	if (defaultdir[0] != '/') {
X+ 		strcpy(cq_opts, defaultdir);
X+ 		sprintf(defaultdir, "%s/%s", DEFAULTDIR, cq_opts);
X+ 	}
X+ 
X  	/* now that we have parsed the args, we can got to the
X  	 * dir where the files are kept and do some work.
X  	 */
X***************
X*** 126,131 ****
X--- 183,196 ----
X  		exit(FAIL);
X  	}
X  	if((mflag)||(rflag)) {
X+ 		if(realuser!=(getpwnam(LOGIN)->pw_uid)) {
X+ 			printf("Sorry -- you can not create a world\n");
X+ 			printf("you need to be logged in as %s",LOGIN);
X+ 			if (strcmp(LOGIN, ntn[0].leader)!=0) {
X+ 				printf(" or %s",ntn[0].leader);
X+ 			}
X+ 			printf("\n");
X+ 		}
X  		sprintf(string,"%sup",isonfile);
X  		unlink(string);
X  		makeworld(rflag);
X***************
X*** 177,200 ****
X  		newlogin();
X  		unlink(string);
X  		exit(SUCCESS);
X! 	} else if (pflag) {	/* print a map of the game */
X  		fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
X  		fprintf(stderr,"while the maps will be sent to stdout.\n\n");
X  		fprintf(stderr,"\tThe valid options are,\n");
X  		fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
X! 		fprintf(stderr,"\t\t3) nations\n\n");
X  		fprintf(stderr,"\tWhat type of map? ");
X  		scanf("%hd", &dismode);
X  		fprintf(stderr,"\n");
X  		if(dismode==1) printele();
X  		else if(dismode==2) printveg();
X! 		else pr_ntns();
X  		exit(SUCCESS);
X  	} else if (xflag) {	/* update the game */
X  #ifndef OGOD
X! 		if ( getuid() != (getpwnam(LOGIN))->pw_uid ){
X  			printf("sorry -- your uid is invalid for updating\n");
X! 			printf("you need to be logged in as %s\n",LOGIN);
X  			exit(FAIL);
X  		}
X  #endif OGOD
X--- 242,291 ----
X  		newlogin();
X  		unlink(string);
X  		exit(SUCCESS);
X! 	}
X! 
X! #ifdef OGOD
X! 	if((realuser!=(getpwnam(LOGIN)->pw_uid))&&
X! 	   (realuser!=(getpwnam(ntn[0].leader)->pw_uid))) {
X! 		printf("Sorry -- you can not administrate conquer\n");
X! 		printf("you need to be logged in as %s",LOGIN);
X! 		if (strcmp(LOGIN, ntn[0].leader)!=0) {
X! 			printf(" or %s",ntn[0].leader);
X! 		}
X! 		printf("\n");
X! 		exit(FAIL);
X! 	}
X! #endif OGOD
X! 
X! 	if (pflag) {	/* print a map of the game */
X  		fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
X  		fprintf(stderr,"while the maps will be sent to stdout.\n\n");
X  		fprintf(stderr,"\tThe valid options are,\n");
X  		fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
X! 		fprintf(stderr,"\t\t3) nations\n");
X! 		fprintf(stderr,"\t\t4) designations\n\n");
X  		fprintf(stderr,"\tWhat type of map? ");
X  		scanf("%hd", &dismode);
X  		fprintf(stderr,"\n");
X  		if(dismode==1) printele();
X  		else if(dismode==2) printveg();
X! 		else if(dismode==3) pr_ntns();
X! 		else if(dismode==4) pr_desg();
X! 		else {
X! 		     fprintf(stderr,"must be 1-4\n");
X! 		     exit(FAIL);
X! 		}
X  		exit(SUCCESS);
X  	} else if (xflag) {	/* update the game */
X  #ifndef OGOD
X! 		if((realuser!=(getpwnam(LOGIN)->pw_uid))&&
X! 		   (realuser!=(getpwnam(ntn[0].leader)->pw_uid))) {
X  			printf("sorry -- your uid is invalid for updating\n");
X! 			printf("you need to be logged in as %s",LOGIN);
X! 			if (strcmp(LOGIN, ntn[0].leader)!=0) {
X! 				printf(" or %s",ntn[0].leader);
X! 			}
X! 			printf("\n");
X  			exit(FAIL);
X  		}
X  #endif OGOD
X*** oextcmds.c	Tue Jul 18 22:04:41 1989
X--- extcmds.c	Tue Jul 18 22:04:56 1989
X***************
X*** 174,184 ****
X  	}
X  	/* eliminate half starting movement if start out on march */
X  	if( P_ASTAT==MARCH && new_stat!=MARCH ) {
X! 		if(P_AMOVE<(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/5){
X  			errormsg("That troop has gone too far to stop marching");
X  			return;
X  		}
X! 		P_AMOVE-=(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/5;
X  		AADJMOV;
X  	}
X  	if(new_stat == SCOUT) {
X--- 174,184 ----
X  	}
X  	/* eliminate half starting movement if start out on march */
X  	if( P_ASTAT==MARCH && new_stat!=MARCH ) {
X! 		if(P_AMOVE<(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/50){
X  			errormsg("That troop has gone too far to stop marching");
X  			return;
X  		}
X! 		P_AMOVE-=(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/50;
X  		AADJMOV;
X  	}
X  	if(new_stat == SCOUT) {
X***************
X*** 308,313 ****
X--- 308,316 ----
X  	mvaddstr(LINES-2, 0, "How many men to split? ");
X  	refresh();
X  	men = get_number();
X+ 	if(men <= 0) {
X+ 		return;
X+ 	}
X  	reducearmy(armynum,men);
X  }
X  
X***************
X*** 357,363 ****
X  	mvaddstr(LINES-4,0,"enter a valid leader unit/army group id: ");
X  	refresh();
X  	group = get_number();
X! 	if( group < 0 || group > MAXARM || curntn->arm[group].sold <=0){
X  		errormsg("invalid unit number");
X  		return;
X  	}
X--- 360,369 ----
X  	mvaddstr(LINES-4,0,"enter a valid leader unit/army group id: ");
X  	refresh();
X  	group = get_number();
X! 	if(group < 0) {
X! 		return;
X! 	}
X! 	if(group > MAXARM || curntn->arm[group].sold <=0){
X  		errormsg("invalid unit number");
X  		return;
X  	}
X*** omakeworl.c	Tue Jul 18 22:04:42 1989
X--- makeworl.c	Tue Jul 18 22:04:56 1989
X***************
X*** 45,51 ****
X  int	rflag;		/* TRUE if you wish to read in a map from mapfiles */
X  {
X  	char passwd[PASSLTH+1],*getpass();
X! 	char newstring[200];
X  	FILE *fopen();
X  
X  	/*abort if datafile currently exists*/
X--- 45,51 ----
X  int	rflag;		/* TRUE if you wish to read in a map from mapfiles */
X  {
X  	char passwd[PASSLTH+1],*getpass();
X! 	char newstring[BIGLTH];
X  	FILE *fopen();
X  
X  	/*abort if datafile currently exists*/
X***************
X*** 87,93 ****
X--- 87,112 ----
X    	}
X  
X  	strncpy(ntn[0].passwd,crypt(passwd,SALT),PASSLTH);
X+ 
X+ 	/* finally ask for the secondary administrator */
X+ 	printf("\nYou may now designate an alternate ruler for this world.");
X  	while(TRUE) {
X+ 		printf("\nWhat demi-god shall rule this world? ");
X+ 		gets( newstring );
X+ 		if (strlen(newstring)==0) {
X+ 			printf("\nGod blesses this world with his presense!\n");
X+ 			(void) strcpy(ntn[0].leader,LOGIN);
X+ 			break;
X+ 		} else if (strlen(newstring) <= LEADERLTH) {
X+ 			/* HOW DO YOU VERIFY THAT IT IS AN ACTUAL USER? */
X+ 			printf("\nThe demi-god %s may administrate this new world.\n",newstring);
X+ 			(void) strncpy(ntn[0].leader,newstring,LEADERLTH);
X+ 			break;
X+ 		}
X+ 		printf("\nName too long.");
X+ 	}
X+ 
X+ 	while(TRUE) {
X  		printf("\nplease enter the size of the world\n");
X  
X  		printf("values should be divisible by 8 & greater than 23\n");
X***************
X*** 126,131 ****
X--- 145,151 ----
X  	if( rflag==FALSE ) createworld();
X  	else readmap();	/* read map in from mapfiles */
X  	rawmaterials();
X+ 
X  	verifydata(__FILE__,__LINE__);
X  	writedata();
X  
X***************
X*** 712,724 ****
X  	short	npirates=0,nbarbarians=0,nnomads=0,nlizards=0;
X  
X  	FILE *fp, *fopen();
X! 	char line[80],allign;
X! 	char fname[80];
X  
X! 	/*set up god but dont place*/
X  	curntn = &ntn[0];
X  	strcpy(curntn->name,"unowned");
X- 	strcpy(curntn->leader,"god");
X  	curntn->race=GOD;
X  	curntn->location=GOD;
X  	curntn->powers=KNOWALL;	/* so god can see the map */
X--- 732,743 ----
X  	short	npirates=0,nbarbarians=0,nnomads=0,nlizards=0;
X  
X  	FILE *fp, *fopen();
X! 	char line[LINELTH+1],allign;
X! 	char fname[FILELTH];
X  
X! 	/*set up god but dont place -- do not change leader name*/
X  	curntn = &ntn[0];
X  	strcpy(curntn->name,"unowned");
X  	curntn->race=GOD;
X  	curntn->location=GOD;
X  	curntn->powers=KNOWALL;	/* so god can see the map */
X***************
X*** 757,764 ****
X  		} else if( country==NTOTAL-2 ) {
X  			strcpy(curntn->name,"savages");
X  			strcpy(curntn->leader,"shaman");
X! 			curntn->active=NPC_BARBARIAN;
X! 			curntn->race=BARBARIAN;
X  		} else if( country==NTOTAL-3 ) {
X  			strcpy(curntn->name,"nomad");
X  			strcpy(curntn->leader,"khan");
X--- 776,783 ----
X  		} else if( country==NTOTAL-2 ) {
X  			strcpy(curntn->name,"savages");
X  			strcpy(curntn->leader,"shaman");
X! 			curntn->active=NPC_SAVAGE;
X! 			curntn->race=SAVAGE;
X  		} else if( country==NTOTAL-3 ) {
X  			strcpy(curntn->name,"nomad");
X  			strcpy(curntn->leader,"khan");
X***************
X*** 800,806 ****
X  			} else	if(nnomads < MAXARM )	nnomads++;
X  			break;
X  	}
X! 	printf("placing %d lizards, %d pirates, %d barbarians, and %d nomads\n",
X  		nlizards,npirates,nbarbarians,nnomads);
X  
X  	while((nlizards+npirates+nbarbarians+nnomads > 0 )&&(loopcnt++ <5000)) {
X--- 819,825 ----
X  			} else	if(nnomads < MAXARM )	nnomads++;
X  			break;
X  	}
X! 	printf("placing %d lizards, %d pirates, %d savages, and %d nomads\n",
X  		nlizards,npirates,nbarbarians,nnomads);
X  
X  	while((nlizards+npirates+nbarbarians+nnomads > 0 )&&(loopcnt++ <5000)) {
X***************
X*** 810,816 ****
X  			armynum=lizarmy;
X  		} else	if( nbarbarians>0 ) {	
X  			for(country=1;country<NTOTAL;country++)
X! 				if( ntn[country].active==NPC_BARBARIAN ) break;
X  			armynum=barbarmy;
X  		} else	if( nnomads>0 )	 {	
X  			for(country=1;country<NTOTAL;country++)
X--- 829,835 ----
X  			armynum=lizarmy;
X  		} else	if( nbarbarians>0 ) {	
X  			for(country=1;country<NTOTAL;country++)
X! 				if( ntn[country].active==NPC_SAVAGE ) break;
X  			armynum=barbarmy;
X  		} else	if( nnomads>0 )	 {	
X  			for(country=1;country<NTOTAL;country++)
X***************
X*** 933,939 ****
X  			P_ATYPE=defaultunit(country);
X  			nomadarmy++;
X  			break;
X! 		case NPC_BARBARIAN:
X  			nbarbarians--;
X  			P_AXLOC=x;
X  			P_AYLOC=y;
X--- 952,958 ----
X  			P_ATYPE=defaultunit(country);
X  			nomadarmy++;
X  			break;
X! 		case NPC_SAVAGE:
X  			nbarbarians--;
X  			P_AXLOC=x;
X  			P_AYLOC=y;
X***************
X*** 947,953 ****
X  
X  	/* put random monsters around the world */
X  	for(country=1;country<NTOTAL;country++) {
X! 		if( ntn[country].active != NPC_BARBARIAN ) continue;
X  		curntn = &ntn[country];
X  		armynum=barbarmy;
X  		while(armynum<MAXARM) {
X--- 966,972 ----
X  
X  	/* put random monsters around the world */
X  	for(country=1;country<NTOTAL;country++) {
X! 		if( ntn[country].active != NPC_SAVAGE ) continue;
X  		curntn = &ntn[country];
X  		armynum=barbarmy;
X  		while(armynum<MAXARM) {
X***************
X*** 999,1008 ****
X  		}
X  	}
X  	printf("reading npc nation data from file: %s\n",npcsfile);
X! 	printf("and adding 1 nation per %d land sectors\n",MONSTER);
X  
X  	cnum=1;
X! 	while(fgets(line,80,fp)!=NULL) {
X  		/*read and parse a new line*/
X  		if(line[0]!='#') {
X  			xloc = yloc = -1;
X--- 1018,1027 ----
X  		}
X  	}
X  	printf("reading npc nation data from file: %s\n",npcsfile);
X! 	printf("and adding 1 nation per %d land sectors\n",NPC);
X  
X  	cnum=1;
X! 	while(fgets(line,LINELTH,fp)!=NULL) {
X  		/*read and parse a new line*/
X  		if(line[0]!='#') {
X  			xloc = yloc = -1;
X***************
X*** 1015,1021 ****
X  
X  			country=cnum;
X  			curntn = &ntn[country];
X! 			if( cnum > MAPX*MAPY/MONSTER*(100-pwater)/100 ) {
X  				printf("world too small to add npc nation %d %s\n",cnum,curntn->name);
X  				continue;
X  			} 
X--- 1034,1040 ----
X  
X  			country=cnum;
X  			curntn = &ntn[country];
X! 			if( cnum > MAPX*MAPY/NPC*(100-pwater)/100 ) {
X  				printf("world too small to add npc nation %d %s\n",cnum,curntn->name);
X  				continue;
X  			} 
X*** orandeven.c	Tue Jul 18 22:04:44 1989
X--- randeven.c	Tue Jul 18 22:04:57 1989
X***************
X*** 14,20 ****
X  extern FILE *fnews;
X  extern short country;
X  
X! char eventstr[80];
X  int xpos,ypos;		/* saved x and y position */
X  
X  char *randevents[] = {
X--- 14,20 ----
X  extern FILE *fnews;
X  extern short country;
X  
X! char eventstr[LINELTH+1];
X  int xpos,ypos;		/* saved x and y position */
X  
X  char *randevents[] = {
X***************
X*** 47,53 ****
X  /* 26 */ "fire ravishes town",
X  /* 27 */ "black plague rages",
X  /* 28 */ "pirates raid",
X! /* 29 */ "barbarian raid",
X  /* 30 */ "wizard grants power",
X  /* 31 */ "magic item grants magic power",
X  /* 32 */ "ores in one mine run out",
X--- 47,53 ----
X  /* 26 */ "fire ravishes town",
X  /* 27 */ "black plague rages",
X  /* 28 */ "pirates raid",
X! /* 29 */ "savages raid",
X  /* 30 */ "wizard grants power",
X  /* 31 */ "magic item grants magic power",
X  /* 32 */ "ores in one mine run out",
X***************
X*** 645,651 ****
X  		case 28: /*pirate raid on harbor*/
X  			done=FALSE;
X  			break;
X! 		case 29: /*barbarian raid*/
X  			done=FALSE;
X  			break;
X  		case 30: /*new magician + RANDOM POWER*/
X--- 645,651 ----
X  		case 28: /*pirate raid on harbor*/
X  			done=FALSE;
X  			break;
X! 		case 29: /*savages raid*/
X  			done=FALSE;
X  			break;
X  		case 30: /*new magician + RANDOM POWER*/
X*** ocexecute.c	Tue Jul 18 22:04:39 1989
X--- cexecute.c	Tue Jul 18 22:04:57 1989
X***************
X*** 29,42 ****
X  {
X  	FILE *fp, *fopen();
X  	int cmd,savectry;
X! 	char comment[20];
X! 	char temp[10];
X  	long longvar,long2var;
X  	int armynum;
X  	short int x,y;
X  	int execed=0;
X  	int done=FALSE;
X! 	char line[80];
X  
X  	/* initialize startgold */
X  	if( isupdate==0) startgold = curntn->tgold;
X--- 29,42 ----
X  {
X  	FILE *fp, *fopen();
X  	int cmd,savectry;
X! 	char comment[LINELTH];
X! 	char temp[LINELTH];
X  	long longvar,long2var;
X  	int armynum;
X  	short int x,y;
X  	int execed=0;
X  	int done=FALSE;
X! 	char line[BIGLTH];
X  
X  	/* initialize startgold */
X  	if( isupdate==0) startgold = curntn->tgold;
X*** oforms.c	Tue Jul 18 22:04:41 1989
X--- forms.c	Tue Jul 18 22:04:58 1989
X***************
X*** 19,24 ****
X--- 19,25 ----
X  extern FILE	*fexe, *fnews;
X  extern short	country,redraw;
X  extern long	startgold;
X+ extern short	Gaudy;
X  
X  static char helplist[MAXHELP][20]={"Commands", "General Info",
X  	"Military","Magic","Designations","Other"};
X***************
X*** 119,125 ****
X  diploscrn()
X  {
X  	int i,j;
X! 	char k,name[20];
X  	short nation, offset, count, count2, temp;
X  	short isgod=FALSE;
X  	long	bribecost;
X--- 120,126 ----
X  diploscrn()
X  {
X  	int i,j;
X! 	char k,name[LINELTH];
X  	short nation, offset, count, count2, temp;
X  	short isgod=FALSE;
X  	long	bribecost;
X***************
X*** 283,291 ****
X  			mvaddstr(j++,0,"INPUT:");
X  			refresh();
X  			temp = get_number();
X  			if((temp<=UNMET)||(temp>JIHAD)
X  			||((isgod==FALSE)&&(temp==UNMET))){
X! 				mvprintw(23,0,"SORRY, Invalid inputs -- hit return");
X  				refresh();
X  				getch();
X  				if(isgod==TRUE) reset_god();
X--- 284,296 ----
X  			mvaddstr(j++,0,"INPUT:");
X  			refresh();
X  			temp = get_number();
X+ 			if(temp<0) {
X+ 				if(isgod==TRUE) reset_god();
X+ 				return;
X+ 			}
X  			if((temp<=UNMET)||(temp>JIHAD)
X  			||((isgod==FALSE)&&(temp==UNMET))){
X! 				mvprintw(LINES-1,0,"SORRY, Invalid inputs -- hit return");
X  				refresh();
X  				getch();
X  				if(isgod==TRUE) reset_god();
X***************
X*** 345,351 ****
X  change()
X  {
X  	float temp;
X! 	char string[10], command[80];
X  	int i, intval;
X  	long	cost,men;
X  	short armynum;
X--- 350,356 ----
X  change()
X  {
X  	float temp;
X! 	char string[LINELTH], command[BIGLTH];
X  	int i, intval;
X  	long	cost,men;
X  	short armynum;
X***************
X*** 355,361 ****
X  #ifdef OGOD
X  	FILE *ftmp;
X  #endif OGOD
X! 	char filename[80];
X  
X  	if(country==0) {
X  		isgod=TRUE;
X--- 360,366 ----
X  #ifdef OGOD
X  	FILE *ftmp;
X  #endif OGOD
X! 	char filename[FILELTH];
X  
X  	if(country==0) {
X  		isgod=TRUE;
X***************
X*** 381,387 ****
X  	standend();
X  	mvprintw(10,0,"capitol loc: x is %d",curntn->capx);
X  	mvprintw(11,0,"             y is %d",curntn->capy);
X- 	mvprintw(12,0,"leader is %s",curntn->leader);
X  	mvprintw(13,0,"class is %s",*(Class+curntn->class));
X  	if(ispc( curntn->active ) )
X  		addstr(" (PC)");
X--- 386,391 ----
X***************
X*** 426,436 ****
X--- 430,442 ----
X  	fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
X  
X  	if (country!=0) {
X+ 		mvprintw(12,0,"leader is %s",curntn->leader);
X  		mvprintw(16,0,"score currently...%ld",curntn->score);
X  		mvprintw(3,COLS-30, "attack bonus.........%+4d%%",curntn->aplus);
X  		mvprintw(4,COLS-30, "defense bonus........%+4d%%",curntn->dplus);
X  		mvprintw(12,COLS-30,"total soldiers....%8ld",curntn->tmil);
X  	} else {
X+ 		mvprintw(12,0,"demigod is %s",curntn->leader);
X  		mvprintw(16,0,"turn currently....%ld",TURN);
X  		mvprintw(3,COLS-30, "mercs attack bonus....+%2d%%",MERCATT);
X  		mvprintw(4,COLS-30, "mercs defense bonus...+%2d%%",MERCDEF);
X***************
X*** 463,471 ****
X  	addstr(" 7) TOGGLE PC <-> NPC");
X  
X  #ifdef OGOD
X!  	if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-24,"HIT 8 TO DESTROY NATION OR 9 TO CHANGE COMMODITY");
X  #else OGOD
X!   	if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-11,"HIT 8 TO DESTROY NATION");
X  #endif OGOD
X  	else mvaddstr(LINES-3,COLS/2-14,"HIT ANY OTHER KEY TO CONTINUE");
X  	standend();
X--- 469,477 ----
X  	addstr(" 7) TOGGLE PC <-> NPC");
X  
X  #ifdef OGOD
X! 	if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-33,"HIT 8 TO DESTROY, 9 TO CHANGE COMMODITY OR '0' TO CHANGE DEMI-GOD");
X  #else OGOD
X! 	if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-24,"HIT 8 TO DESTROY NATION, OR '0' TO CHANGE DEMI-GOD");
X  #endif OGOD
X  	else mvaddstr(LINES-3,COLS/2-14,"HIT ANY OTHER KEY TO CONTINUE");
X  	standend();
X***************
X*** 534,540 ****
X  		refresh();
X  		intval = get_number();
X  		if( intval < 0 )
X! 			errormsg("ERROR - negative tax rate");
X  		else if( intval > 20 )
X  			errormsg("NO WAY! the peasants will revolt!!!");
X  		else if( intval > 10 && (curntn->tsctrs<20 || curntn->score<20) )
X--- 540,546 ----
X  		refresh();
X  		intval = get_number();
X  		if( intval < 0 )
X! 			break;
X  		else if( intval > 20 )
X  			errormsg("NO WAY! the peasants will revolt!!!");
X  		else if( intval > 10 && (curntn->tsctrs<20 || curntn->score<20) )
X***************
X*** 550,556 ****
X  		standend();
X  		refresh();
X  		intval = get_number();
X! 		if(( intval < 0 ) ||( intval > 100 ))
X  			errormsg("ERROR - invalid charity rate");
X  		/* this will protect from both underflow and overflow */
X  		else if((int)curntn->popularity + 2*(intval - (int)curntn->charity)>100)
X--- 556,564 ----
X  		standend();
X  		refresh();
X  		intval = get_number();
X! 		if (intval < 0) {
X! 			break;
X! 		} else if( intval > 100 )
X  			errormsg("ERROR - invalid charity rate");
X  		/* this will protect from both underflow and overflow */
X  		else if((int)curntn->popularity + 2*(intval - (int)curntn->charity)>100)
X***************
X*** 571,577 ****
X  		refresh();
X  		intval = get_number();
X  		if( intval < 0 )
X! 			errormsg("ERROR - negative input");
X  		else if( intval+curntn->terror > 100 )
X  			errormsg("Cant go over 100 terror!!!");
X  		else if((intval > curntn->popularity )
X--- 579,585 ----
X  		refresh();
X  		intval = get_number();
X  		if( intval < 0 )
X! 			break;
X  		else if( intval+curntn->terror > 100 )
X  			errormsg("Cant go over 100 terror!!!");
X  		else if((intval > curntn->popularity )
X***************
X*** 683,688 ****
X--- 691,697 ----
X  				mvaddstr(LINES-1,0,"WHAT IS NEW VALUE FOR TREASURY? ");
X  				refresh();
X  				curntn->tgold = (long) get_number();
X+ 				if (curntn->tgold < 0L) curntn->tgold=0L;
X  				fprintf(ftmp,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNAGOLD ,country,curntn->tgold,"null");
X  				break;
X  			case '2':
X***************
X*** 689,694 ****
X--- 698,704 ----
X  				mvaddstr(LINES-1,0,"WHAT IS NEW AMOUNT OF JEWELS? ");
X  				refresh();
X  				curntn->jewels = (long) get_number();
X+ 				if (curntn->jewels < 0L) curntn->jewels=0L;
X  				fprintf(ftmp,"L_NJWLS\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNARGOLD ,country,curntn->jewels,"null");
X  				break;
X  			case '3':
X***************
X*** 695,700 ****
X--- 705,711 ----
X  				mvaddstr(LINES-1,0,"WHAT IS NEW AMOUNT OF METAL? ");
X  				refresh();
X  				curntn->metals = (long) get_number();
X+ 				if (curntn->metals < 0L) curntn->metals=0L;
X  				fprintf(ftmp,"L_NMETAL\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNAMETAL ,country,curntn->metals,"null");
X  				break;
X  			case '4':
X***************
X*** 701,706 ****
X--- 712,718 ----
X  				mvaddstr(LINES-1,0,"WHAT IS NEW AMOUNT OF FOOD? ");
X  				refresh();
X  				curntn->tfood = (long) get_number();
X+ 				if (curntn->tfood < 0L) curntn->tfood = 0L;
X  				break;
X  			default:
X  				break;
X***************
X*** 709,714 ****
X--- 721,741 ----
X  		}
X  		break;
X  #endif OGOD
X+ 	case '0':
X+ 		if(isgod==TRUE) {
X+ 			mvaddstr(LINES-2,0,"ENTER CONQUER SUPER-USER PASSWORD:");
X+ 			refresh();
X+ 			getstr(string);
X+ 			strcpy(passwd,crypt(string,SALT));
X+ 			if(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0) break;
X+ 			mvaddstr(LINES-1,0,"PROMOTE WHAT USER TO DEMI-GOD? ");
X+ 			refresh();
X+ 			get_nname(string);
X+ 			if (strlen(string)!=0) {
X+ 				strncpy(ntn[0].leader,string,LEADERLTH);
X+ 			}
X+ 		}
X+ 		break;
X  	case 'p':
X  	case 'P': produce(); fclose(fp); return;
X  	case 'b':
X***************
X*** 729,735 ****
X  	int lineno;
X  	FILE *fp, *fopen();
X  	int i,xcnt,ycnt,done=FALSE;
X! 	char line[80],fname[80];
X  
X  	/*find out which helpfile to read in */
X  	clear_bottom(0);
X--- 756,762 ----
X  	int lineno;
X  	FILE *fp, *fopen();
X  	int i,xcnt,ycnt,done=FALSE;
X! 	char line[LINELTH],fname[FILELTH];
X  
X  	/*find out which helpfile to read in */
X  	clear_bottom(0);
X***************
X*** 798,803 ****
X--- 825,852 ----
X  	fclose(fp);
X  }
X  
X+ /* routine to highlight a line for news display */
X+ /* if country name is mentioned.  By T. Kivinen */
X+ mvaddstrnahil(li,col,p)
X+      int li;
X+      int col;
X+      char *p;
X+ {
X+ 	int i,j;
X+ 	move(li,col);
X+ 	for (i=0;p[i];i++) {
X+ 		for (j=0;p[i+j]==ntn[country].name[j];j++);
X+ 		if (ntn[country].name[j]==0 && p[i+j]!='-') {
X+ 			standout();
X+ 			addstr(ntn[country].name);
X+ 			standend();
X+ 			i+=j-1;
X+ 		}
X+ 		else
X+ 			addch(p[i]);
X+ 	}
X+ }
X+ 
X  void
X  newspaper()
X  {
X***************
X*** 806,812 ****
X  	int newpage,choice,done=FALSE;
X  	short pagenum=1;
X  	int i,ydist,xdist;
X! 	char line[80],name[80];
X  
X  	/* check to make sure that there are newspapers */
X  	if (TURN==0) {
X--- 855,861 ----
X  	int newpage,choice,done=FALSE;
X  	short pagenum=1;
X  	int i,ydist,xdist;
X! 	char line[LINELTH],name[FILELTH];
X  
X  	/* check to make sure that there are newspapers */
X  	if (TURN==0) {
X***************
X*** 874,881 ****
X  			mvprintw(3,37-strlen(name)/2,"%s",name+2);
X  			standend();
X  			/* display any pending non-blank lines */
X! 			if(strcmp(line,name)!=0 && strlen(line)>2)
X! 				mvaddstr(lineno++,0,line+2);
X  		} else if(fgets(line,80,fp)==NULL) done=TRUE;
X  		else {
X  			if(line[1]!='.') {
X--- 923,932 ----
X  			mvprintw(3,37-strlen(name)/2,"%s",name+2);
X  			standend();
X  			/* display any pending non-blank lines */
X! 			if(strcmp(line,name)!=0 && strlen(line)>2) {
X! 				if (Gaudy) mvaddstrnahil(lineno++,0,line+2);
X! 				else mvaddstr(lineno++,0,line+2);
X! 			}
X  		} else if(fgets(line,80,fp)==NULL) done=TRUE;
X  		else {
X  			if(line[1]!='.') {
X***************
X*** 888,894 ****
X  					pagenum=todigit(line[0]);
X  				}
X  				else if(lineno>LINES-4) newpage=FALSE;
X! 				else if(strlen(line)>2) mvaddstr(lineno++,0,line+2);
X  			}
X  		}
X  		if(newpage==FALSE||done==TRUE){
X--- 939,948 ----
X  					pagenum=todigit(line[0]);
X  				}
X  				else if(lineno>LINES-4) newpage=FALSE;
X! 				else if(strlen(line)>2) {
X! 					if (Gaudy) mvaddstrnahil(lineno++,0,line+2);
X! 					else mvaddstr(lineno++,0,line+2);
X! 				}
X  			}
X  		}
X  		if(newpage==FALSE||done==TRUE){
X*** omisc.c	Tue Jul 18 22:04:42 1989
X--- misc.c	Tue Jul 18 22:04:58 1989
X***************
X*** 41,47 ****
X  } /* move_file() */
X  #endif CONQUER
X  
X! #ifdef CONQUER
X  long
X  get_number()
X  {
X--- 41,48 ----
X  } /* move_file() */
X  #endif CONQUER
X  
X! /* returns integer input greater than zero or */
X! /* -1 for no input.                           */
X  long
X  get_number()
X  {
X***************
X*** 51,57 ****
X  	/* this routine totally redone to allow deleting */
X  	while(!done) {
X  		ch=getch();
X! 		if(isdigit(ch)) {
X  			/* only print numbers to the screen */
X  			addch(ch);
X  			refresh();
X--- 52,58 ----
X  	/* this routine totally redone to allow deleting */
X  	while(!done) {
X  		ch=getch();
X! 		if(isdigit(ch) && count<12) {
X  			/* only print numbers to the screen */
X  			addch(ch);
X  			refresh();
X***************
X*** 70,80 ****
X  		} else if((ch=='\n')||(ch=='\r')) {
X  			done=TRUE;
X  		}
X- 		if( count >= 12 ) done=TRUE;
X  	}
X  	return( sum );
X  }
X- #endif CONQUER
X  
X  #define INFINITE	1000
X  
X--- 71,82 ----
X  		} else if((ch=='\n')||(ch=='\r')) {
X  			done=TRUE;
X  		}
X  	}
X+ 	if (count==0) {
X+ 		return(-1);
X+ 	}
X  	return( sum );
X  }
X  
X  #define INFINITE	1000
X  
X***************
X*** 935,941 ****
X  {
X  	short armynum, nvynum;
X  	int i, x, y;
X! 	char buf[20];
X  	struct s_nation	*nptr;
X  
X  	nptr = &ntn[country];
X--- 937,943 ----
X  {
X  	short armynum, nvynum;
X  	int i, x, y;
X! 	char buf[LINELTH];
X  	struct s_nation	*nptr;
X  
X  	nptr = &ntn[country];
X***************
X*** 968,974 ****
X  		ntn[i].dstatus[country]=UNMET;
X  		nptr->dstatus[i]=UNMET;
X  	}
X! 
X  	/*if take them you get their gold*/
X  	if(country!=sct[nptr->capx][nptr->capy].owner){
X  		if(nptr->tgold>0) ntn[sct[nptr->capx][nptr->capy].owner].tgold+=nptr->tgold;
X--- 970,982 ----
X  		ntn[i].dstatus[country]=UNMET;
X  		nptr->dstatus[i]=UNMET;
X  	}
X! #ifdef MONSTER
X! 	for(i=NTOTAL-4;i<NTOTAL;i++) {
X! 	        ntn[i].dstatus[country]=WAR;
X! 		nptr->dstatus[i]=WAR;
X! 	}
X! #endif
X! 	
X  	/*if take them you get their gold*/
X  	if(country!=sct[nptr->capx][nptr->capy].owner){
X  		if(nptr->tgold>0) ntn[sct[nptr->capx][nptr->capy].owner].tgold+=nptr->tgold;
X***************
X*** 1302,1309 ****
X  	spread.gold += spread.revfood + spread.revjewels + spread.revmetal + spread.revcity + spread.revcap + spread.revothr;
X  }
X  
X- #ifdef CONQUER
X- 
X  /* string inputing routine to allow deleting */
X  void
X  get_nname(str)
X--- 1310,1315 ----
X***************
X*** 1338,1343 ****
X--- 1344,1351 ----
X  	str[count] = '\0';
X  }
X  
X+ 
X+ #ifdef CONQUER
X  /* routine to find a nation number using name or number  */
X  /* returns NTOTAL+1 if input is invalid; -1 for no input */
X  int
X***************
X*** 1441,1447 ****
X  void
X  mailopen(to)
X  {
X! 	char	line[20];
X  	if(mailok == TRUE) mailclose();
X  
X  	if (to != -2)
X--- 1449,1455 ----
X  void
X  mailopen(to)
X  {
X! 	char	line[LINELTH];
X  	if(mailok == TRUE) mailclose();
X  
X  	if (to != -2)
X***************
X*** 1474,1507 ****
X  int prtflag;	/* if true printf reason */
X  {
X  	register int i;
X  
X  	if((isprint(mark)==0)||(isspace(mark)!=0)) {
X! 		if(prtflag) printf("%c is white space\n",mark);
X  		return(FALSE);
X  	}
X  
X  	for(i=0;ele[i]!='0';i++) if(mark==(*(ele+i))) {
X! 		if(prtflag) printf("%c is elevation character\n",mark);
X  		return(FALSE);
X  	}
X  
X  	for(i=0;veg[i]!='0';i++) if(mark==(*(veg+i))) {
X! 		if(prtflag) printf("%c is vegetition character\n",mark);
X  		return(FALSE);
X  	}
X  
X! 	for(i=1;i<NTOTAL;i++) if(ntn[i].mark==mark) {
X! 		if(prtflag) printf("%c is already used\n",mark);
X  		return(FALSE);
X  	}
X  
X  	if(mark=='*') {
X! 		if(prtflag) printf("%c is *\n",mark);
X  		return(FALSE);
X  	}
X  
X  	if(!isalpha(mark)) {
X! 		if(prtflag) printf("%c is not an alpha character\n",mark);
X  		return(FALSE);
X  	}
X  	return(TRUE);
X--- 1482,1534 ----
X  int prtflag;	/* if true printf reason */
X  {
X  	register int i;
X+ 	char temp[LINELTH];
X  
X  	if((isprint(mark)==0)||(isspace(mark)!=0)) {
X! 		if(prtflag) {
X! 			sprintf(temp,"%c is white space",mark);
X! 			newerror(temp);
X! 		}
X  		return(FALSE);
X  	}
X  
X  	for(i=0;ele[i]!='0';i++) if(mark==(*(ele+i))) {
X! 		if(prtflag) {
X! 			sprintf(temp,"%c is an elevation character",mark);
X! 			newerror(temp);
X! 		}
X  		return(FALSE);
X  	}
X  
X  	for(i=0;veg[i]!='0';i++) if(mark==(*(veg+i))) {
X! 		if(prtflag) {
X! 			sprintf(temp,"%c is a vegetation character",mark);
X! 			newerror(temp);
X! 		}
X  		return(FALSE);
X  	}
X  
X! 	for(i=1;i<NTOTAL;i++) if(isactive(ntn[i].active) && ntn[i].mark==mark) {
X! 		if(prtflag) {
X! 			sprintf(temp,"%c is already used",mark);
X! 			newerror(temp);
X! 		}
X  		return(FALSE);
X  	}
X  
X  	if(mark=='*') {
X! 		if(prtflag) {
X! 			sprintf(temp,"%c is used by Monsters",mark);
X! 			newerror(temp);
X! 		}
X  		return(FALSE);
X  	}
X  
X  	if(!isalpha(mark)) {
X! 		if(prtflag) {
X! 			sprintf(temp,"%c is not an alpha character",mark);
X! 			newerror(temp);
X! 		}
X  		return(FALSE);
X  	}
X  	return(TRUE);
X***************
X*** 1624,1635 ****
X  	case TG_silver:
X  	case TG_pearls:	break;
X  	case TG_dye:
X! 	case TG_silk:
X! 	case TG_gold:	if(ntn[nation].wealth < 5) return(0); break;
X! 	case TG_rubys:
X! 	case TG_ivory:	if(ntn[nation].wealth < 10) return(0); break;
X! 	case TG_diamonds:
X! 	case TG_platinum:	if(ntn[nation].wealth < 20) return(0); break;
X  	default:		break;
X  	};
X  
X--- 1651,1662 ----
X  	case TG_silver:
X  	case TG_pearls:	break;
X  	case TG_dye:
X! 	case TG_silk:	if(ntn[nation].wealth < 5) return(0); break;
X! 	case TG_gold:
X! 	case TG_rubys:	if(ntn[nation].wealth < 8) return(0); break;
X! 	case TG_ivory:	if(ntn[nation].wealth < 15) return(0); break;
X! 	case TG_diamonds:	if(ntn[nation].wealth < 20) return(0); break;
X! 	case TG_platinum:	if(ntn[nation].wealth < 25) return(0); break;
X  	default:		break;
X  	};
X  
X*** oreports.c	Tue Jul 18 22:04:44 1989
X--- reports.c	Tue Jul 18 22:04:59 1989
X***************
X*** 171,177 ****
X  				mvaddstr(ypos++,0,"TO WHAT ARMY: ");
X  				refresh();
X  				armynum = get_number();
X! 
X  				combinearmies(armynum,oldarmy);
X  				break;
X  			case '5':
X--- 171,177 ----
X  				mvaddstr(ypos++,0,"TO WHAT ARMY: ");
X  				refresh();
X  				armynum = get_number();
X! 				if (armynum < 0) break;
X  				combinearmies(armynum,oldarmy);
X  				break;
X  			case '5':
X***************
X*** 270,277 ****
X  					mvaddstr(ypos++,0,"What is the New Total Soldiers: ");
X  					refresh();
X  					men = get_number();
X! 					P_ASOLD=men;
X! 					AADJMEN;
X  				}
X  				break;
X  #endif OGOD
X--- 270,279 ----
X  					mvaddstr(ypos++,0,"What is the New Total Soldiers: ");
X  					refresh();
X  					men = get_number();
X! 					if (men>0) {
X! 						P_ASOLD=men;
X! 						AADJMEN;
X! 					}
X  				}
X  				break;
X  #endif OGOD
X***************
X*** 569,574 ****
X--- 571,577 ----
X  			clrtoeol();
X  			refresh();
X  			nvynum = get_number();
X+ 			if(nvynum<0) break;
X  #ifdef TRADE
X  			if (curntn->nvy[nvynum].commodity==TRADED) {
X  				errormsg("Sorry - That Navy is up for trade");
X***************
X*** 593,599 ****
X  				clrtoeol();
X  				refresh();
X  				newnavy = get_number();
X! 				if(newnavy<0 || newnavy>=MAXNAVY) {
X  					errormsg("Sorry - Invalid Navy unit");
X  					break;
X  				}
X--- 596,603 ----
X  				clrtoeol();
X  				refresh();
X  				newnavy = get_number();
X! 				if(newnavy < 0) break;
X! 				if(newnavy >= MAXNAVY) {
X  					errormsg("Sorry - Invalid Navy unit");
X  					break;
X  				}
X***************
X*** 700,706 ****
X  					clrtoeol();
X  					refresh();
X  					newnavy = get_number();
X! 					if(newnavy>P_NWAR(shipsize)) newnavy=0;
X  					NSUB_WAR(newnavy);
X  					(void) addwships(navy,shipsize,newnavy);
X  				}
X--- 704,710 ----
X  					clrtoeol();
X  					refresh();
X  					newnavy = get_number();
X! 					if(newnavy>P_NWAR(shipsize)||newnavy<0) newnavy=0;
X  					NSUB_WAR(newnavy);
X  					(void) addwships(navy,shipsize,newnavy);
X  				}
X***************
X*** 709,715 ****
X  					clrtoeol();
X  					refresh();
X  					newnavy = get_number();
X! 					if(newnavy>P_NMER(shipsize)) newnavy=0;
X  					NSUB_MER(newnavy);
X  					(void) addmships(navy,shipsize,newnavy);
X  				}
X--- 713,719 ----
X  					clrtoeol();
X  					refresh();
X  					newnavy = get_number();
X! 					if(newnavy>P_NMER(shipsize)||newnavy<0) newnavy=0;
X  					NSUB_MER(newnavy);
X  					(void) addmships(navy,shipsize,newnavy);
X  				}
X***************
X*** 718,724 ****
X  					clrtoeol();
X  					refresh();
X  					newnavy = get_number();
X! 					if(newnavy>P_NGAL(shipsize)) newnavy=0;
X  					NSUB_GAL(newnavy);
X  					(void) addgships(navy,shipsize,newnavy);
X  				}
X--- 722,728 ----
X  					clrtoeol();
X  					refresh();
X  					newnavy = get_number();
X! 					if(newnavy>P_NGAL(shipsize)||newnavy<0) newnavy=0;
X  					NSUB_GAL(newnavy);
X  					(void) addgships(navy,shipsize,newnavy);
X  				}
X***************
X*** 779,785 ****
X  						clrtoeol();
X  						refresh();
X  						newnavy = get_number();
X! 						if(newnavy>N_MASK) newnavy=0;
X  						(void) NADD_WAR(newnavy);
X  					}
X  					for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
X--- 783,789 ----
X  						clrtoeol();
X  						refresh();
X  						newnavy = get_number();
X! 						if(newnavy>N_MASK||newnavy<0) newnavy=0;
X  						(void) NADD_WAR(newnavy);
X  					}
X  					for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
X***************
X*** 787,793 ****
X  						clrtoeol();
X  						refresh();
X  						newnavy = get_number();
X! 						if(newnavy>N_MASK) newnavy=0;
X  						(void) NADD_MER(newnavy);
X  					}
X  					for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
X--- 791,797 ----
X  						clrtoeol();
X  						refresh();
X  						newnavy = get_number();
X! 						if(newnavy>N_MASK||newnavy<0) newnavy=0;
X  						(void) NADD_MER(newnavy);
X  					}
X  					for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
X***************
X*** 795,801 ****
X  						clrtoeol();
X  						refresh();
X  						newnavy = get_number();
X! 						if(newnavy>N_MASK) newnavy=0;
X  						(void) NADD_GAL(newnavy);
X  					}
X  					NADJWAR;
X--- 799,805 ----
X  						clrtoeol();
X  						refresh();
X  						newnavy = get_number();
X! 						if(newnavy>N_MASK||newnavy<0) newnavy=0;
X  						(void) NADD_GAL(newnavy);
X  					}
X  					NADJWAR;
X***************
X*** 827,835 ****
X  					mvaddstr(ypos,0,"What value for crew/ship unit: ");
X  					refresh();
X  					crew = get_number();
X! 					if (crew>=0 && crew<=SHIPCREW)
X  						P_NCREW = crew;
X! 					NADJCRW;
X  				}
X  				break;
X  #endif OGOD
X--- 831,840 ----
X  					mvaddstr(ypos,0,"What value for crew/ship unit: ");
X  					refresh();
X  					crew = get_number();
X! 					if (crew>=0 && crew<=SHIPCREW) {
X  						P_NCREW = crew;
X! 						NADJCRW;
X! 					}
X  				}
X  				break;
X  #endif OGOD
X*** oupdate.c	Tue Jul 18 22:04:46 1989
X--- update.c	Tue Jul 18 22:05:00 1989
X***************
X*** 26,32 ****
X  void
X  update()
X  {
X! 	char command[80],filename[80];
X  
X  	sprintf(filename,"%s%d",newsfile,TURN);
X  	if ((fnews=fopen(filename,"w"))==NULL) {
X--- 26,32 ----
X  void
X  update()
X  {
X! 	char command[BIGLTH],filename[FILELTH];
X  
X  	sprintf(filename,"%s%d",newsfile,TURN);
X  	if ((fnews=fopen(filename,"w"))==NULL) {
X***************
X*** 217,223 ****
X  	if((designation==DDEVASTATED)||(Attr<0)||(movecost[x][y]<0)) Attr=0;
SHAR_EOF
echo "End of part 2, continue with part 3"
echo "3" > s2_seq_.tmp
exit 0