|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 5822 (0x16be) Types: TextFile Names: »Bugs«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Rogue_clone/Bugs«
Here is a list of fixes for bugs and non-portable items found in my rogue clone. Many thanks to those who reported the problems, I would appreciate any further reports, particularly if the stuff below does not fix what it is intended to fix. Tim Stoehr tims@zeus.TEK.COM ---------------------------------------------------- 1.) To implement the ',' command, which allows the rogue to pick up an item he is currently standing on, do the following: a.) Add the following case into the large switch statement in the routine play_level() in play.c: case ',': kick_into_pack(); break; b.) Add the following routine at the bottom of pack.c: kick_into_pack() { object *obj; char desc[DCOLS]; short n, stat; if (!(dungeon[rogue.row][rogue.col] & OBJECT)) { message("nothing here", 0); } else { if (obj = pick_up(rogue.row, rogue.col, &stat)) { get_desc(obj, desc); if (obj->what_is == GOLD) { message(desc, 0); free_object(obj); } else { n = strlen(desc); desc[n] = '('; desc[n+1] = obj->ichar; desc[n+2] = ')'; desc[n+3] = 0; message(desc, 0); } } if (obj || (!stat)) { (void) reg_move(); } } } 2.) In score.c, there is a bug. In the routine get_value(), add the following case to the existing switch statement: case RING: val = id_rings[wc].value * (obj->class + 1); break; 3.) In message.c, change any occurrence of %D to %ld, for portability. 4.) In message.c, there is a line that looks like: sprintf(buf, "%d", rogue.gold); or sprintf(buf, "%D", rogue.gold); Change this line to: sprintf(buf, "%ld", rogue.gold); Do the same for the line in score.c, in the routine killed_by(), which looks like this: sprintf(buf+strlen(buf), "%d gold", rogue.gold); That is, change the %d (or %D) to %ld. 5.) In message.c, delete the line in rgetchar(), that looks like this: printf(CL); if CL is undefined during compilation. 6.) Delete the routine free_free_list() in object.c, and any calls to it. 7.) In the Makefile, UNIX_SYSV (system V) folks may not need -ltermlib. And folks with Microport sysV for PC/AT's will need to link with -Ml. 8.) In move.c, in the function gr_dir(), add break clauses to each of the cases in the switch statement. This is a bug. 9.) In init.c, change the global variable restore_file to rest_file, as well as all occurrences of that variable in init.c. This keeps some linkers from confusing the name 'restore_file' with the routine called 'restore' in save.c. 10.) Replace your version of the function get_rand() in random.c with the version given below. This is extremely important for machines with 16-bit (as opposed to 32-bit) integers. get_rand(x, y) register int x, y; { register int r, t; long lr; if (x > y) { t = y; y = x; x = t; } lr = rrandom(); lr &= (long) 0x00007fff; r = (int) lr; r = (r % ((y - x) + 1)) + x; return(r); } 11.) In level.c, replace the declaration and initialization of random_rooms with the following: short random_rooms[MAXROOMS] = {3, 7, 5, 2, 0, 6, 1, 4, 8}; This is probably just cosmetic. 12.) In zap.c, replace the function tele_away() with the following version: tele_away(monster) object *monster; { short row, col; if (monster->m_flags & HOLDS) { being_held = 0; } gr_row_col(&row, &col, (FLOOR | TUNNEL | STAIRS | OBJECT)); mvaddch(monster->row, monster->col, monster->trail_char); dungeon[monster->row][monster->col] &= ~MONSTER; monster->row = row; monster->col = col; dungeon[row][col] |= MONSTER; monster->trail_char = mvinch(row, col); if (detect_monster || rogue_can_see(row, col)) { mvaddch(row, col, gmc(monster)); } } 13.) In init.c, replace the function start_window() with the following version: start_window() { crmode(); noecho(); #ifndef BAD_NONL nonl(); #endif BAD_NONL md_control_keybord(0); } The symbol BAD_NONL is to be defined during compilation on systems whose curses library has a buggy nonl() function/macro. This may be noticed if the game draws things on the wrong lines, particularly during score file display. Nonl() is not really necessary, although it is a nice optimization for curses. 14.) In the routine inventory() in inventory.c: for (j = 1; j < i; j++) { mvaddstr(j, col, descs[j-1]); } should be changed to: for (j = 1; ((j < i) && (j < DROWS)); j++) { mvaddstr(j, col, descs[j-1]); } This might cause some problems if the player fills his pack and has no duplicate items. The inventory, plus prompt line, would go one line past the status line. 15.) Some compilers are sensitive about names after a #endif, e.g. #ifdef NAME #endif NAME If this happens to you, simply change #endif NAME to #endif /* NAME */. 16.) [Optional] For general cleanup, in rogue.h insert the following just prior to the #endif CURSES line (at the end of the file): #else #include <curses.h> Then delete the three lines: #ifndef CURSES #include <curses.h> #endif CURSES that appear at the top of every file except main.c, random.c and ring.c. 17.) Replace the file machdep.c with the one included in this posting. 18.) Create a new file "patchlevel.h" that has a single line in it: #define PATCHLEVEL 1