billr@saab.CNA.TEK.COM (Bill Randle) (02/02/90)
Submitted-by: Adam Bryant <adb@cs.bu.edu> Posting-number: Volume 8, Issue 84 Archive-name: conquer4/Patch8 Patch-To: conquer4: Volume 6, Issue 83-96 [[Well, remember when I said I wouldn't be sending out any more patches for conquer version 4? Guess, what? I lied! This one is short, though, and is used to fix any a few bugs. [Although two of them were major, thus the need to fix them] The patch fixes: - memory leak in move_people() at end of update.c - redrawing/recentering of screen when at edge of map - troop combination problems - unique monster/leader names. [woppidy doo!] - and a few other tidbits. Hopefully, this should fix those major bugs that I was told about and keep people happy until version 5.0 comes out. [I estimate a month or so before I begin beta testing and then a couple of months after that for the official 5.0 posting to comp.sources.games. So, hopefully it will be released by/during this summer] Enjoy, adam]] #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: patches08 # Wrapped by billr@saab on Thu Feb 1 09:24:55 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'patches08' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patches08'\" else echo shar: Extracting \"'patches08'\" \(30045 characters\) sed "s/^X//" >'patches08' <<'END_OF_FILE' X*** opatchlevel.h Wed Jan 31 20:58:16 1990 X--- patchlevel.h Wed Jan 31 20:58:24 1990 X*************** X*** 1 **** X! #define PATCHLEVEL 7 X--- 1 ---- X! #define PATCHLEVEL 8 X*** onotes.v4 Wed Jan 31 20:58:16 1990 X--- notes.v4 Wed Jan 31 20:58:25 1990 X*************** X*** 283,294 **** X 227. misc.c[498]: fixed overflow on gold scoring [Kenneth J Dalka] X 228. adjusted inflation calculation in update.c and reports.c. X 229. added the inflation estimation to the budget report. X! 230. fixed bug with division of charity by population. [Dave F.] X 231. prevent passage of fleets through hostile cities. X 232. added some checks in npc.c for ownership in drafting in some sectors. X 233. removed destruction of troops on peaks, now that flight is possible. X 234. changed to min zero in attractiveness, now drift will no longer occur X for sectors with "zero" attractiveness. [Dave F.] X X ------------------------------------------------------------------------- X | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V5 | X--- 283,319 ---- X 227. misc.c[498]: fixed overflow on gold scoring [Kenneth J Dalka] X 228. adjusted inflation calculation in update.c and reports.c. X 229. added the inflation estimation to the budget report. X! 230. fixed bug with division of charity by population. [Charles C. Fu] X 231. prevent passage of fleets through hostile cities. X 232. added some checks in npc.c for ownership in drafting in some sectors. X 233. removed destruction of troops on peaks, now that flight is possible. X 234. changed to min zero in attractiveness, now drift will no longer occur X for sectors with "zero" attractiveness. [Dave F.] X+ ===4.0 patch number seven released => 4.7 =============================== X+ 235. update.c[1327]: "ispc(country)" => "ispc(curntn->active)" X+ 236. added a note to README and fixed credit in notes.v4 file. X+ 237. made sure npcs do not change scout status. X+ 238. fixed bug with include files in check.c. [J. Bayer] X+ 239. update.c[1073]: declare items as unsigned char [Rodney Orr] X+ 240. update.c[1541]: rewrote move_people() routine to avoid memory leak X+ and to use only 5 / MAPX as much memory. X+ 241. adjusted casting in propuction screen for food consumption. X+ 242. trade.c: added check for unexpected end of file in trade [R. Orr] X+ 243. newlogin.c: removed the check() in the routine. X+ 244. added news notification during update if npc/pc mode is changed. X+ 245. removed useless ifdef REMAKE statement in admin.c. X+ 246. added check for edge of screen unnecessarily redrawing. X+ 247. added check for motion beyond edge of screen. X+ 248. added stoppage for going beyond map edges. X+ 249. checked for invalid reads of commerce file in trade.c. X+ 250. changed float casting back to longs at line 1052 of update.c. X+ 251. did the same for the calculations in function budget() of report.c. X+ 252. fixed display.c designation to show tofood(sctptr, country). X+ 253. made Dragyn the nation leader name and Dragon the monster name. X+ 254. restricted marching troops from being grouped. (could get into X+ defend mode this way; even when they had marched too far). X+ 255. allow recombination of troops with same status and same type X+ unless the type is TRADED or ON_BOARD. X X ------------------------------------------------------------------------- X | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V5 | X*** oadmin.c Wed Jan 31 20:58:14 1990 X--- admin.c Wed Jan 31 20:58:26 1990 X*************** X*** 204,212 **** X printf(".\n"); X exit(FAIL); X } X- #ifdef REMAKE X remake=TRUE; X- #endif /*REMAKE*/ X printf("************* WARNING!!!! *******************\n\n"); X printf(" There is already a game in progress.\n\n"); X printf("*********************************************\n\n"); X--- 204,210 ---- X*************** X*** 227,233 **** X } X #else X /* check for god permissions */ 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.\n",LOGIN); X exit(FAIL); X--- 225,231 ---- X } X #else X /* check for god permissions */ 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.\n",LOGIN); X exit(FAIL); X*** oextcmds.c Wed Jan 31 20:58:14 1990 X--- extcmds.c Wed Jan 31 20:58:26 1990 X*************** X*** 113,122 **** X { X int nocomb_stat(); X X! if (armynum < 0 || armynum >= MAXARM || X! army2 < 0 || army2 >= MAXARM || X! armynum == army2 || X! (nocomb_stat(P_ASTAT) == TRUE) || X (nocomb_stat(curntn->arm[army2].stat) == TRUE) || X curntn->arm[army2].stat == SIEGE || /* may not jump out */ X curntn->arm[army2].stat == SORTIE || /* of these statuses */ X--- 113,129 ---- X { X int nocomb_stat(); X X! if (armynum < 0 || armynum >= MAXARM X! || army2 < 0 || army2 >= MAXARM || P_ASOLD == 0 X! || curntn->arm[army2].sold == 0) { X! errormsg("Selected unit doesn't exist"); X! return; X! } X! if (P_ASTAT != curntn->arm[army2].stat X! || P_ATYPE != curntn->arm[army2].unittyp X! || P_ATYPE >= MINLEADER X! || P_ASTAT == ONBOARD || P_ASTAT == TRADED) { X! if ((nocomb_stat(P_ASTAT) == TRUE) || X (nocomb_stat(curntn->arm[army2].stat) == TRUE) || X curntn->arm[army2].stat == SIEGE || /* may not jump out */ X curntn->arm[army2].stat == SORTIE || /* of these statuses */ X*************** X*** 124,129 **** X--- 131,137 ---- X P_ATYPE!=curntn->arm[army2].unittyp) { X errormsg("Selected armies not legal"); X return; X+ } X } X if((curntn->arm[army2].xloc!=P_AXLOC) X ||(curntn->arm[army2].yloc!=P_AYLOC)) { X*************** X*** 348,353 **** X--- 356,365 ---- X } X if(P_ATYPE==A_ZOMBIE) { X errormsg("Your Zombies just don't seem inspired"); X+ return; X+ } X+ if(P_ASTAT==MARCH) { X+ errormsg("Your troops must stop marching before they can be lead"); X return; X } X if(armynum<0 || armynum >= MAXARM || P_ASTAT==SCOUT || X*** orandeven.c Wed Jan 31 20:58:16 1990 X--- randeven.c Wed Jan 31 20:58:27 1990 X*************** X*** 627,636 **** X break; X } X } X- break; X /* decrement to contain proper value */ X xpos--; X ypos--; X case 27: X /*plague -- 40% of populace in cities dies*/ X strcpy(eventstr,"40% of populace & armies in towns die"); X--- 627,636 ---- X break; X } X } X /* decrement to contain proper value */ X xpos--; X ypos--; X+ break; X case 27: X /*plague -- 40% of populace in cities dies*/ X strcpy(eventstr,"40% of populace & armies in towns die"); X*** ocexecute.c Wed Jan 31 20:58:14 1990 X--- cexecute.c Wed Jan 31 20:58:28 1990 X*************** X*** 15,21 **** X #include "data.h" X extern long startgold; X extern short country; X! extern FILE *fexe; X extern char fison[]; X X #ifdef CONQUER X--- 15,21 ---- X #include "data.h" X extern long startgold; X extern short country; X! extern FILE *fexe, *fnews; X extern char fison[]; X X #ifdef CONQUER X*************** X*** 161,166 **** X--- 161,174 ---- X curntn->reputation = y; X break; X case NTAX: /* set nations tax rate */ X+ #ifdef ADMIN X+ if (ispc(curntn->active) && !ispc(x)) { X+ fprintf(fnews, "1.\tNation %s is now being run by the computer.\n", curntn->name); X+ } X+ if (ispc(x) && !ispc(curntn->active)) { X+ fprintf(fnews, "1.\tNation %s is no longer being run by the computer.\n", curntn->name); X+ } X+ #endif /*ADMIN*/ X curntn->tax_rate = armynum; X curntn->active = x; X curntn->charity = y; X*** oforms.c Wed Jan 31 20:58:14 1990 X--- forms.c Wed Jan 31 20:58:28 1990 X*************** X*** 413,422 **** X mvprintw(5,0,"active is %d",curntn->active); X mvprintw(6,0,"tax_rate...... %2d%%",curntn->tax_rate); X mvprintw(7,0,"inflation..... %2d%%",curntn->inflation); X! i=10*curntn->tax_rate-curntn->popularity-curntn->terror-3*curntn->charity; X if( i<0 ) i=0; X mvprintw(8,0,"peasant revolt %2d%%",(i*PREVOLT)/100); X! i=5*curntn->tax_rate - curntn->prestige; X if( i<0 ) i=0; X mvprintw(9,0,"other revolt.. %2d%%",(i*PREVOLT)/100); X standend(); X--- 413,422 ---- X mvprintw(5,0,"active is %d",curntn->active); X mvprintw(6,0,"tax_rate...... %2d%%",curntn->tax_rate); X mvprintw(7,0,"inflation..... %2d%%",curntn->inflation); X! i=(int)10*curntn->tax_rate-curntn->popularity-curntn->terror-3*curntn->charity; X if( i<0 ) i=0; X mvprintw(8,0,"peasant revolt %2d%%",(i*PREVOLT)/100); X! i=(int)5*curntn->tax_rate - curntn->prestige; X if( i<0 ) i=0; X mvprintw(9,0,"other revolt.. %2d%%",(i*PREVOLT)/100); X standend(); X*************** X*** 441,447 **** X temp = P_EATRATE; X mvprintw(7,COLS/2-12, "eatrate.......%3.2f",temp); X mvprintw(8,COLS/2-12, "wealth........ %3d",curntn->wealth); X! mvprintw(9,COLS/2-12,"charity....... %2d%%",curntn->charity); X mvprintw(10,COLS/2-12,"communication.%3.2f",(float) P_NTNCOM); X mvprintw(11,COLS/2-12,"reputation.... %3d",curntn->reputation); X mvprintw(12,COLS/2-12,"spoilrate.....%3d%%",curntn->spoilrate); X--- 441,447 ---- X temp = P_EATRATE; X mvprintw(7,COLS/2-12, "eatrate.......%3.2f",temp); X mvprintw(8,COLS/2-12, "wealth........ %3d",curntn->wealth); X! mvprintw(9,COLS/2-12, "charity....... %2d%%",curntn->charity); X mvprintw(10,COLS/2-12,"communication.%3.2f",(float) P_NTNCOM); X mvprintw(11,COLS/2-12,"reputation.... %3d",curntn->reputation); X mvprintw(12,COLS/2-12,"spoilrate.....%3d%%",curntn->spoilrate); X*** oreports.c Wed Jan 31 20:58:16 1990 X--- reports.c Wed Jan 31 20:58:29 1990 X*************** X*** 361,372 **** X chty = max((money*(long)curntn->charity)/100L,0L); X mvprintw(15,COLS-50,"CHARITY.......................%8ld",chty); X mvprintw(16,COLS-50,"NET INCOME....................%8ld",money); X infmoney = startgold + money - chty; X if (infmoney > 1000000L) { X! infmoney = (long)(infmoney / (100.0+(float)curntn->inflation/4.0)) * 100L; X } else { X! infmoney= (long) (infmoney * 100L) / (100.0 + (float) curntn->inflation/4.0); X } X mvprintw(17,COLS-50,"LOSS DUE TO INFLATION.........%8ld",(startgold + money-chty)-infmoney); X standout(); X mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",infmoney); X--- 361,374 ---- X chty = max((money*(long)curntn->charity)/100L,0L); X mvprintw(15,COLS-50,"CHARITY.......................%8ld",chty); X mvprintw(16,COLS-50,"NET INCOME....................%8ld",money); X+ X infmoney = startgold + money - chty; X if (infmoney > 1000000L) { X! infmoney = (infmoney / (400L + curntn->inflation)) * 400L; X } else { X! infmoney = (infmoney * 400L) / (400L + curntn->inflation); X } X+ X mvprintw(17,COLS-50,"LOSS DUE TO INFLATION.........%8ld",(startgold + money-chty)-infmoney); X standout(); X mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",infmoney); X*************** X*** 425,433 **** X mvprintw(9,0, "granary now holds.........%8ld tons",curntn->tfood); X mvprintw(10,0, "%8ld people in farms..%8ld tons",spread.infarm,spread.food - curntn->tfood); X fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__); X! mvprintw(12,0, "%8ld people @ %3.1f eat.%8.0f tons",spread.civilians,P_EATRATE,P_EATRATE*(float)spread.civilians); X fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__); X! mvprintw(13,0, "%8ld soldiers eat.....%8.0f tons",military,military*2*P_EATRATE); X military+= military+spread.civilians; /* military is amount eaten */ X fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__); X standout(); X--- 427,435 ---- X mvprintw(9,0, "granary now holds.........%8ld tons",curntn->tfood); X mvprintw(10,0, "%8ld people in farms..%8ld tons",spread.infarm,spread.food - curntn->tfood); X fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__); X! mvprintw(12,0, "%8ld people @ %3.1f eat.%8.0ld tons",spread.civilians,P_EATRATE,(long)(P_EATRATE*(float)spread.civilians)); X fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__); X! mvprintw(13,0, "%8ld soldiers eat.....%8.0ld tons",military,(long)(military*2*P_EATRATE)); X military+= military+spread.civilians; /* military is amount eaten */ X fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__); X standout(); X*** oupdate.c Wed Jan 31 20:58:17 1990 X--- update.c Wed Jan 31 20:58:30 1990 X*************** X*** 25,30 **** X--- 25,31 ---- X extern short country; X int disarray; /* TRUE if nation in disarray */ X int **attr; /* sector attractiveness */ X+ long **newpop; /* storage for old population */ X X /****************************************************************/ X /* UPDATE() - updates the whole world */ X*************** X*** 523,534 **** X updexecs() X { X register struct s_sector *sptr; X! register int i, j, x, y; X #ifdef XENIX X register int z; X #endif /*XENIX*/ X int armynum; X! int moved,done,loop=0,number=0; X void move_people(); X int execed[NTOTAL]; X X--- 524,535 ---- X updexecs() X { X register struct s_sector *sptr; X! register int x, y; X #ifdef XENIX X register int z; X #endif /*XENIX*/ X int armynum; X! int done, loop=0, number=0; X void move_people(); X int execed[NTOTAL]; X X*************** X*** 535,540 **** X--- 536,544 ---- X check(); X attr = (int **) m2alloc(MAPX,MAPY,sizeof(int)); X check(); X+ newpop = (long **) m2alloc(5,MAPY,sizeof(long)); X+ check(); X+ X for(country=0;country<NTOTAL;country++) X if( isntn(ntn[country].active) ) execed[country]=FALSE; X else { X*************** X*** 700,705 **** X--- 704,710 ---- X &&( rand()%2==0)) ntn[country].spellpts+=1; X } X free(attr); X+ free(newpop); X } X X /****************************************************************/ X*************** X*** 1044,1054 **** X X /* now find new total gold talons in nations*/ X if (curntn->tgold > 1000000L) { X! curntn->tgold = (long)(curntn->tgold / X! (100.0+(float)curntn->inflation/4.0)) * 100L; X } else { X! curntn->tgold = (long) (curntn->tgold * 100L) / X! (100.0 + (float) curntn->inflation/4.0); X } X X /* provide goods production */ X--- 1049,1059 ---- X X /* now find new total gold talons in nations*/ X if (curntn->tgold > 1000000L) { X! curntn->tgold = (curntn->tgold / X! (400L + curntn->inflation)) * 400L; X } else { X! curntn->tgold = (curntn->tgold * 400L) / X! (400L + curntn->inflation); X } X X /* provide goods production */ X*************** X*** 1070,1076 **** X int AX, AY, AT; /* armies x,y locations, type : for speed */ X int armynum,nvynum,flag,dfltunit; X int army2,asmen,dsmen,nation,sieges=0; X! char siegex[MAXSIEGE],siegey[MAXSIEGE],siegok[MAXSIEGE]; X X fprintf(stderr,"updating armies and navies\n"); X for(country=1;country<NTOTAL;country++) X--- 1075,1081 ---- X int AX, AY, AT; /* armies x,y locations, type : for speed */ X int armynum,nvynum,flag,dfltunit; X int army2,asmen,dsmen,nation,sieges=0; X! unsigned char siegex[MAXSIEGE],siegey[MAXSIEGE],siegok[MAXSIEGE]; X X fprintf(stderr,"updating armies and navies\n"); X for(country=1;country<NTOTAL;country++) X*************** X*** 1409,1415 **** X if(curntn->tgold > GOLDTHRESH*curntn->jewels){ X /* buy jewels off commodities board */ X xx=curntn->tgold-GOLDTHRESH*curntn->jewels; X! if (ispc(country)) { X if (mailopen(country)!=(-1)) { X fprintf(fm,"Message from Conquer\n\n"); X fprintf(fm,"Gold imbalance forced your treasury to purchase\n"); X--- 1414,1420 ---- X if(curntn->tgold > GOLDTHRESH*curntn->jewels){ X /* buy jewels off commodities board */ X xx=curntn->tgold-GOLDTHRESH*curntn->jewels; X! if (ispc(curntn->active)) { X if (mailopen(country)!=(-1)) { X fprintf(fm,"Message from Conquer\n\n"); X fprintf(fm,"Gold imbalance forced your treasury to purchase\n"); X*************** X*** 1536,1582 **** X void X move_people() X { X register struct s_sector *sptr; X! register int i, j, x, y; X! int moved, t_attr; X! long **newpop, *curpop; X X! newpop = (long **) m2alloc(MAPX, MAPY, sizeof(long)); X X! for (x = 0; x < MAPX; x++) X! for (y = 0; y < MAPY; y++) X! if (sct[x][y].owner == country) X! newpop[x][y] = sct[x][y].people; X! else newpop[x][y] = 0; X X! for (x = 0; x < MAPX; x++) X! for (y = 0; y < MAPY; y++) { X! sptr = &sct[x][y]; X! if ((sptr->owner == country) && (sptr->people != 0)) { X! X! for (t_attr = 0, i = x - 2; i < x + 3; i++) X! for (j = y - 2; j < y + 3; j++) X! if ((ONMAP(i, j)) && (sct[i][j].owner == country)) X! t_attr += attr[i][j]; X! X! if (t_attr > 0) { X! t_attr *= 5; X! curpop = &newpop[x][y]; X! for (i = x - 2; i < x + 3; i++) X for (j = y - 2; j < y + 3; j++) X! if ((ONMAP(i, j)) && (sct[i][j].owner == country)) { X! moved = sptr->people * attr[i][j]; X! if (moved > 0) { X! moved /= t_attr; X! *curpop -= moved; X! newpop[i][j] += moved; X } X } X } X } X } X! for (x = 0; x < MAPX; x++) X! for (y = 0; y < MAPY; y++) X! if (sct[x][y].owner == country) X! sct[x][y].people = newpop[x][y]; X } X--- 1541,1606 ---- X void X move_people() X { X+ register int x, y, i, j; X register struct s_sector *sptr; X! int t_attr; X! long *curpop, moved; X X! /* store the first two rows for computation */ X! for (x = 0; x < 3; x++) { X! for (y = 0; y < MAPY; y++) { X! if (sct[x][y].owner == country) X! newpop[x][y] = sct[x][y].people; X! else newpop[x][y] = 0L; X! } X! } X X! /* go through entire map to move civilians */ X! for (x = 0; x < MAPX; x++) { X! for (y = 0; y < MAPY; y++) { X! sptr = &sct[x][y]; X! if ((sptr->owner == country) && (sptr->people != 0)) { X X! for (t_attr = 0, i = x - 2; i < x + 3; i++) X for (j = y - 2; j < y + 3; j++) X! if (ONMAP(i, j)) X! t_attr += attr[i][j]; X! X! if (t_attr > 0) { X! t_attr *= 5; X! curpop = &newpop[x%5][y]; X! for (i = x - 2; i < x + 3; i++) X! for (j = y - 2; j < y + 3; j++) X! if (ONMAP(i, j)) { X! moved = sptr->people * attr[i][j]; X! if (moved > 0) { X! moved /= t_attr; X! *curpop -= moved; X! newpop[i%5][j] += moved; X! } X } X } X } X } X+ /* store old row, and read in new */ X+ for (y = 0; y < MAPY; y++) { X+ if (x > 1) { X+ if (sct[x-2][y].owner == country) X+ sct[x-2][y].people = newpop[(x-2)%5][y]; X+ } X+ if (x < MAPX - 3) { X+ if (sct[x+3][y].owner == country) X+ newpop[(x+3)%5][y] = sct[x+3][y].people; X+ else newpop[(x+3)%5][y] = 0L; X+ } X+ } X } X! X! /* assign values for final rows */ X! for (x = MAPX - 2; x < MAPX; x++) { X! for (y = 0; y < MAPY; y++) { X! if (sct[x][y].owner == country) X! sct[x][y].people = newpop[x%5][y]; X! } X! } X } X*** odata.c Wed Jan 31 20:58:14 1990 X--- data.c Wed Jan 31 20:58:31 1990 X*************** X*** 62,71 **** X "Knights", "Gryfins","Elephants","Zombies","Spy","Scout", X "King","Baron","Emperor","Prince","Wizard","Mage", X "Pope","Bishop","Admiral","Captain","Warlord","Lord", X! "Demon","Devil","Dragon","Wyrm","Shadow","Nazgul", X "Spirit", "Assasin", "Efreet", "Gargoyl", "Wraith", X "Hero", "Centaur", "Giant", "Suphero", "Mummy", X! "Elmentl", "Mintaur", "Demon", "Balrog", "Dragon" X }; X X #ifdef CONQUER X--- 62,71 ---- X "Knights", "Gryfins","Elephants","Zombies","Spy","Scout", X "King","Baron","Emperor","Prince","Wizard","Mage", X "Pope","Bishop","Admiral","Captain","Warlord","Lord", X! "Demon","Devil","Dragyn","Wyrm","Shadow","Nazgul", X "Spirit", "Assasin", "Efreet", "Gargoyl", "Wraith", X "Hero", "Centaur", "Giant", "Suphero", "Mummy", X! "Elmentl", "Mintaur", "Daemon", "Balrog", "Dragon" X }; X X #ifdef CONQUER X*************** X*** 80,86 **** X "Demn","Devl","Drag","Wyrm","Shad","Nazg", X "spir", "Assn", "efr", "Garg", "Wra", X "Hero", "Cent", "gt", "Shro", "Mumm", X! "Elem", "mino", "dem", "Bal", "Drag" X }; X #endif CONQUER X int unitminsth[]= /* min strength of a unit */ X--- 80,86 ---- X "Demn","Devl","Drag","Wyrm","Shad","Nazg", X "spir", "Assn", "efr", "Garg", "Wra", X "Hero", "Cent", "gt", "Shro", "Mumm", X! "Elem", "mino", "daem", "Bal", "Drgn" X }; X #endif CONQUER X int unitminsth[]= /* min strength of a unit */ X*** onewlogin.c Wed Jan 31 20:58:15 1990 X--- newlogin.c Wed Jan 31 20:58:32 1990 X*************** X*** 849,855 **** X break; X } X } X- check(); X X /* check for save */ X newmsg("Save this nation? [ny]"); X--- 849,854 ---- X*** odisplay.c Wed Jan 31 20:58:14 1990 X--- display.c Wed Jan 31 20:58:32 1990 X*************** X*** 220,226 **** X break; X case DI_DESI: /*designation*/ X if(sct[x+xoffset][y+yoffset].owner==0){ X! if(tofood( &sct[x+xoffset][y+yoffset],sct[x+xoffset][y+yoffset].owner)!=0) X ch=sct[x+xoffset][y+yoffset].altitude; X else ch=sct[x+xoffset][y+yoffset].vegetation; X } X--- 220,226 ---- X break; X case DI_DESI: /*designation*/ X if(sct[x+xoffset][y+yoffset].owner==0){ X! if(tofood( &sct[x+xoffset][y+yoffset],country)!=0) X ch=sct[x+xoffset][y+yoffset].altitude; X else ch=sct[x+xoffset][y+yoffset].vegetation; X } X*************** X*** 408,418 **** X void X coffmap() X { X! if((xcurs<=0)||(ycurs<=0)||(xcurs>=SCREEN_X_SIZE-1) X! ||((ycurs>=SCREEN_Y_SIZE-1))||((XREAL)>=MAPX) X! ||((YREAL)>=MAPY)) { X! centermap(); X! redraw=PART; X } X X if(redraw!=DONE) { X--- 408,418 ---- X void X coffmap() X { X! if( xcurs<0 || (XREAL!=0 && xcurs==0) || (ycurs<0) || X! (YREAL!=0 && ycurs==0) || xcurs>=SCREEN_X_SIZE-1 || X! ycurs>=SCREEN_Y_SIZE-1 || XREAL>=MAPX || YREAL>=MAPY) { X! centermap(); X! redraw=PART; X } X X if(redraw!=DONE) { X*** omain.c Wed Jan 31 20:58:15 1990 X--- main.c Wed Jan 31 20:58:33 1990 X*************** X*** 574,581 **** X case 'b': /*move south west*/ X pager=0; X selector=0; X! xcurs--; X! ycurs++; X break; X case 'B': /*budget*/ X redraw=FULL; X--- 574,581 ---- X case 'b': /*move south west*/ X pager=0; X selector=0; X! if (XREAL > 0) xcurs--; X! if (YREAL < MAPY - 1) ycurs++; X break; X case 'B': /*budget*/ X redraw=FULL; X*************** X*** 620,632 **** X case 'H': /*scroll west*/ X pager=0; X selector=0; X! xcurs-=((COLS-22)/4); X break; X case '4': X case 'h': /*move west*/ X pager=0; X selector=0; X! xcurs--; X break; X case 'I': /*campaign information*/ X camp_info(); X--- 620,633 ---- X case 'H': /*scroll west*/ X pager=0; X selector=0; X! if (XREAL > (COLS-22)/4) xcurs-=((COLS-22)/4); X! else xcurs = -xoffset; X break; X case '4': X case 'h': /*move west*/ X pager=0; X selector=0; X! if (XREAL > 0) xcurs--; X break; X case 'I': /*campaign information*/ X camp_info(); X*************** X*** 635,669 **** X case 'J': /*scroll down*/ X pager=0; X selector=0; X! ycurs+=((SCREEN_Y_SIZE)/2); X break; X case '2': X case 'j': /*move down*/ X pager=0; X selector=0; X! ycurs++; X break; X case '8': X case 'k': /*move up*/ X pager=0; X selector=0; X! ycurs--; X break; X case 'K': /*scroll up*/ X pager=0; X selector=0; X! ycurs-=((SCREEN_Y_SIZE)/2); X break; X case '6': X case 'l': /*move east*/ X pager=0; X selector=0; X! xcurs++; X break; X case 'L': /*scroll east*/ X pager=0; X selector=0; X! xcurs+=((COLS-22)/4); X break; X case 'm': /*move selected item to new x,y */ X mymove(); X--- 636,674 ---- X case 'J': /*scroll down*/ X pager=0; X selector=0; X! if (YREAL + (SCREEN_Y_SIZE)/2 < MAPY) X! ycurs+=((SCREEN_Y_SIZE)/2); X! else ycurs = MAPY - yoffset - 1; X break; X case '2': X case 'j': /*move down*/ X pager=0; X selector=0; X! if (YREAL < MAPY - 1) ycurs++; X break; X case '8': X case 'k': /*move up*/ X pager=0; X selector=0; X! if (YREAL > 0) ycurs--; X break; X case 'K': /*scroll up*/ X pager=0; X selector=0; X! if (YREAL > (SCREEN_Y_SIZE)/2) ycurs-=((SCREEN_Y_SIZE)/2); X! else ycurs = -yoffset; X break; X case '6': X case 'l': /*move east*/ X pager=0; X selector=0; X! if (XREAL < MAPX - 1) xcurs++; X break; X case 'L': /*scroll east*/ X pager=0; X selector=0; X! if (XREAL + (COLS-22)/4 < MAPX) xcurs+=((COLS-22)/4); X! else xcurs = MAPX - xoffset - 1; X break; X case 'm': /*move selected item to new x,y */ X mymove(); X*************** X*** 680,687 **** X case 'n': /*move south-east*/ X pager=0; X selector=0; X! ycurs++; X! xcurs++; X break; X case 'N': /*read newspaper */ X redraw=PART; X--- 685,692 ---- X case 'n': /*move south-east*/ X pager=0; X selector=0; X! if (YREAL < MAPY - 1) ycurs++; X! if (XREAL < MAPX - 1) xcurs++; X break; X case 'N': /*read newspaper */ X redraw=PART; X*************** X*** 762,775 **** X case 'u': /*move north-east*/ X pager=0; X selector=0; X! ycurs--; X! xcurs++; X break; X case 'U': /* scroll north-east */ X pager=0; X selector=0; X! xcurs+=((COLS-22)/4); X! ycurs-=((SCREEN_Y_SIZE)/2); X break; X case 'v': /* version credits */ X credits(); X--- 767,782 ---- X case 'u': /*move north-east*/ X pager=0; X selector=0; X! if (YREAL > 0) ycurs--; X! if (XREAL < MAPX - 1) xcurs++; X break; X case 'U': /* scroll north-east */ X pager=0; X selector=0; X! if (XREAL + (COLS-22)/4 < MAPX) xcurs+=((COLS-22)/4); X! else xcurs = MAPX - xoffset - 1; X! if (YREAL > (SCREEN_Y_SIZE)/2) ycurs-=((SCREEN_Y_SIZE)/2); X! else ycurs = -yoffset; X break; X case 'v': /* version credits */ X credits(); X*************** X*** 801,814 **** X case 'y': /*move north-west*/ X pager=0; X selector=0; X! ycurs--; X! xcurs--; X break; X case 'Y': /* scroll north-west */ X pager=0; X selector=0; X! xcurs-=((COLS-22)/4); X! ycurs-=((SCREEN_Y_SIZE)/2); X break; X case 'Z': /*move civilians up to 2 spaces*/ X moveciv(); X--- 808,823 ---- X case 'y': /*move north-west*/ X pager=0; X selector=0; X! if (YREAL > 0) ycurs--; X! if (XREAL > 0) xcurs--; X break; X case 'Y': /* scroll north-west */ X pager=0; X selector=0; X! if (XREAL < (COLS-22)/4) xcurs = -xoffset; X! else xcurs-=((COLS-22)/4); X! if (YREAL < (SCREEN_Y_SIZE)/2) ycurs = -yoffset; X! else ycurs-=((SCREEN_Y_SIZE)/2); X break; X case 'Z': /*move civilians up to 2 spaces*/ X moveciv(); X*** onpc.c Wed Jan 31 20:58:16 1990 X--- npc.c Wed Jan 31 20:58:33 1990 X*************** X*** 522,527 **** X--- 522,528 ---- X case TRADED: X case ONBOARD: X case GENERAL: X+ case SCOUT: X break; X default: X P_ASTAT=DEFEND; X*** otrade.c Wed Jan 31 20:58:17 1990 X--- trade.c Wed Jan 31 20:58:34 1990 X*************** X*** 81,93 **** X } X /* read in all of the data */ X while (notopen==FALSE && !feof(tfile)) { X! fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum], X! &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]); X! if (deal[itemnum]==NOSALE) { X! /* remove item from sales list */ X! deal[type1[itemnum]]=NOSALE; X! } else if (deal[itemnum]==SELL) { X! itemnum++; X } X } X if (notopen==FALSE) fclose(tfile); X--- 81,97 ---- X } X /* read in all of the data */ X while (notopen==FALSE && !feof(tfile)) { X! holdint = fscanf(tfile,"%d %d %d %d %ld %ld %d\n", X! &deal[itemnum],&natn[itemnum],&type1[itemnum], X! &type2[itemnum],&lvar1[itemnum], X! &lvar2[itemnum],&extra[itemnum]); X! if (holdint == 7) { X! if (deal[itemnum]==NOSALE) { X! /* remove item from sales list */ X! deal[type1[itemnum]]=NOSALE; X! } else if (deal[itemnum]==SELL) { X! itemnum++; X! } X } X } X if (notopen==FALSE) fclose(tfile); X*************** X*** 899,906 **** X } X /* read in all of the transactions */ X while(!feof(tfile)) { X! fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum], X! &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]); X if (deal[itemnum]==NOSALE) { X if (natn[itemnum]==country) X takeback(country,type1[type1[itemnum]],lvar1[type1[itemnum]],extra[type1[itemnum]],TRUE); X--- 903,910 ---- X } X /* read in all of the transactions */ X while(!feof(tfile)) { X! if (7 != fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum], X! &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum])) break; X if (deal[itemnum]==NOSALE) { X if (natn[itemnum]==country) X takeback(country,type1[type1[itemnum]],lvar1[type1[itemnum]],extra[type1[itemnum]],TRUE); X*************** X*** 946,953 **** X } X /* read in all of the transactions */ X while(!feof(tfile)) { X! fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum], X! &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum]); X if (deal[itemnum]==NOSALE) { X /* remove item from sales list */ X deal[type1[itemnum]]=NOSALE; X--- 950,957 ---- X } X /* read in all of the transactions */ X while(!feof(tfile)) { X! if (7 != fscanf(tfile,"%d %d %d %d %ld %ld %d\n",&deal[itemnum], X! &natn[itemnum],&type1[itemnum],&type2[itemnum],&lvar1[itemnum],&lvar2[itemnum],&extra[itemnum])) break; X if (deal[itemnum]==NOSALE) { X /* remove item from sales list */ X deal[type1[itemnum]]=NOSALE; X*************** X*** 979,984 **** X--- 983,989 ---- X } X } X unlink(tradefile); X+ if (itemnum == 0) return; X /* reopen the file for unsold commodities */ X if ((tfile=fopen(tradefile,"w")) == NULL) { X /* error on opening file */ X*** ocheck.c Wed Jan 31 20:58:14 1990 X--- check.c Wed Jan 31 20:58:34 1990 X*************** X*** 3,8 **** X--- 3,12 ---- X X #include <ctype.h> X #include <stdio.h> X+ #ifndef FILELOCK X+ #include <sys/types.h> X+ #include <sys/stat.h> X+ #endif X #include "header.h" X #include "data.h" X X*************** X*** 55,61 **** X __file__,__line__,country,i,a->xloc,a->yloc,a->sold); X a->sold = 0; X } X! if( a->stat == ONBOARD && a->smove > 0) { X /* don't echo since this is still getting */ X /* set some place someplace I can't find yet */ X a->smove = 0; X--- 59,65 ---- X __file__,__line__,country,i,a->xloc,a->yloc,a->sold); X a->sold = 0; X } X! if( a->stat == ONBOARD && a->smove != 0) { X /* don't echo since this is still getting */ X /* set some place someplace I can't find yet */ X a->smove = 0; X END_OF_FILE if test 30045 -ne `wc -c <'patches08'`; then echo shar: \"'patches08'\" unpacked with wrong size! fi # end of 'patches08' fi echo shar: End of shell archive. exit 0