Changeset 155
- Timestamp:
- 06/05/07 15:25:10 (1 year ago)
- Files:
-
- trunk/src/cmd1.c (modified) (1 diff)
- trunk/src/cmd3.c (modified) (2 diffs)
- trunk/src/cmd5.c (modified) (1 diff)
- trunk/src/files.c (modified) (4 diffs)
- trunk/src/init1.c (modified) (1 diff)
- trunk/src/init2.c (modified) (1 diff)
- trunk/src/load.c (modified) (1 diff)
- trunk/src/main-crb.c (modified) (2 diffs)
- trunk/src/main-gcu.c (modified) (2 diffs)
- trunk/src/main-gtk.c (modified) (1 diff)
- trunk/src/main-ros.c (modified) (1 diff)
- trunk/src/main-win.c (modified) (2 diffs)
- trunk/src/object2.c (modified) (2 diffs)
- trunk/src/save.c (modified) (1 diff)
- trunk/src/spells2.c (modified) (3 diffs)
- trunk/src/x-spell.c (modified) (1 diff)
- trunk/src/z-form.c (modified) (1 diff)
- trunk/src/z-form.h (modified) (1 diff)
- trunk/src/z-util.c (modified) (2 diffs)
- trunk/src/z-util.h (modified) (3 diffs)
- trunk/src/z-virt.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd1.c
r152 r155 500 500 if (!inven_carry_okay(o_ptr)) return (FALSE); 501 501 502 /* Object is marked to notpickup */502 /* Object is marked to pickup */ 503 503 if ((k_info[o_ptr->k_idx].squelch == NO_SQUELCH_NEVER_PICKUP) && 504 504 object_aware_p(o_ptr)) return (FALSE); trunk/src/cmd3.c
r152 r155 191 191 192 192 /* Process preventions */ 193 /* XXX Perhaps this should be factored out to a sep erate function? */193 /* XXX Perhaps this should be factored out to a separate function? */ 194 194 while (s) 195 195 { … … 544 544 545 545 /*Mark the view to be updated*/ 546 p_ptr->update |= (PU_FORGET_VIEW | PU_UPDATE_VIEW); ;546 p_ptr->update |= (PU_FORGET_VIEW | PU_UPDATE_VIEW); 547 547 } 548 548 } trunk/src/cmd5.c
r136 r155 577 577 spell = get_spell(o_ptr, "browse", TRUE, TRUE); 578 578 if (spell < 0) break; 579 579 580 580 /* Browse the spell */ 581 581 browse_spell(spell); trunk/src/files.c
r153 r155 4495 4495 if(mode == 0) 4496 4496 { 4497 fprintf(htm, "<!DOCTYPE html>"); 4498 fprintf(htm, "<html\n"); 4499 fprintf(htm, "<head>\n"); 4500 fprintf(htm, " <meta=\"generator\" content=\"%s %d.%d.%d\">\n", 4497 fprintf(htm, "<!DOCTYPE html><html><head>\n"); 4498 fprintf(htm, " <meta='generator' content='%s %d.%d.%d'>\n", 4501 4499 VERSION_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); 4502 4500 fprintf(htm, " <title>%s</title>\n", name); 4503 4501 fprintf(htm, "</head>\n\n"); 4504 fprintf(htm, "<body text=\"#FFFFFF\" bgcolor=\"#000000\">\n");4505 fprintf(htm, "<pre> <tt>\n");4502 fprintf(htm, "<body style='color: #fff; background: #000;'>\n"); 4503 fprintf(htm, "<pre>\n"); 4506 4504 } 4507 4505 else … … 4548 4546 4549 4547 /* Write the character and escape special HTML characters */ 4550 if (mode == 0) write_html_escape_char(htm, c);4548 if (mode == 0) write_html_escape_char(htm, c); 4551 4549 else fprintf(htm, "%c", c); 4552 4550 } … … 4558 4556 /* Close the last font-color tag if necessary */ 4559 4557 if (oa != TERM_WHITE) fprintf(htm, close_color_fmt); 4560 if(mode == 0) { 4561 fprintf(htm, "</tt></pre>\n"); 4558 4559 if (mode == 0) 4560 { 4561 fprintf(htm, "</pre>\n"); 4562 4562 fprintf(htm, "</body>\n"); 4563 4563 fprintf(htm, "</html>\n"); … … 4568 4568 } 4569 4569 4570 /* Close it */4571 my_fclose(htm);4572 } 4570 /* Close it */ 4571 my_fclose(htm); 4572 } trunk/src/init1.c
r136 r155 875 875 z_info->s_max = max; 876 876 } 877 877 878 878 /* Process 'O' for "Maximum o_list[] index" */ 879 879 else if (buf[2] == 'O') trunk/src/init2.c
r140 r155 1078 1078 } 1079 1079 1080 /* Place each spell in it 's own book */1080 /* Place each spell in its own book */ 1081 1081 for (spell = 0; spell < z_info->s_max; spell++) 1082 1082 { trunk/src/load.c
r154 r155 1013 1013 for (i = 0; i < inscriptions_count; i++) 1014 1014 { 1015 char tmp[80];1016 1017 rd_s16b(&inscriptions[i].kind_idx);1018 rd_string(tmp, 80);1019 1020 inscriptions[i].inscription_idx = quark_add(tmp);1015 char tmp[80]; 1016 1017 rd_s16b(&inscriptions[i].kind_idx); 1018 rd_string(tmp, sizeof(tmp)); 1019 1020 inscriptions[i].inscription_idx = quark_add(tmp); 1021 1021 } 1022 1022 trunk/src/main-crb.c
r148 r155 3779 3779 3780 3780 3781 /*3782 * Hook to tell the user something, and then crash3783 */3784 static void hook_core(cptr str)3785 {3786 /* XXX Use the debugger */3787 /* DebugStr(str); */3788 3789 /* Warning */3790 if (str) mac_warning(str);3791 if(!save_player())3792 mac_warning("Fatal error -- save failed!");3793 else3794 mac_warning("Fatal error -- game saved successfully");3795 3796 /* Quit */3797 quit(NULL);3798 }3799 3781 3800 3782 /*** Main program ***/ … … 3860 3842 plog_aux = hook_plog; 3861 3843 quit_aux = hook_quit; 3862 core_aux = hook_core;3863 3844 3864 3845 /* Initialize colors */ trunk/src/main-gcu.c
r128 r155 718 718 719 719 /* Format to appropriate size */ 720 strnfmt(buf, sizeof buf, "%.*s", n, s);720 strnfmt(buf, sizeof(buf), "%.*s", n, s); 721 721 722 722 /* Write to screen */ … … 831 831 /* Activate hooks */ 832 832 quit_aux = hook_quit; 833 core_aux = hook_quit;834 833 835 834 /* Require standard size screen */ trunk/src/main-gtk.c
r148 r155 819 819 /* Activate hooks */ 820 820 quit_aux = hook_quit; 821 core_aux = hook_quit;822 821 823 822 /* Set the system suffix */ trunk/src/main-ros.c
r148 r155 170 170 * ultimate benefit. 171 171 */ 172 /* #define HASNOCORE */ 172 #define HASNOCORE 173 173 174 174 /* trunk/src/main-win.c
r153 r155 5025 5025 plog_aux = hack_plog; 5026 5026 quit_aux = hack_quit; 5027 core_aux = hack_quit;5028 5027 5029 5028 /* Prepare the filepaths */ … … 5065 5064 plog_aux = hook_plog; 5066 5065 quit_aux = hook_quit; 5067 core_aux = hook_quit;5068 5066 5069 5067 /* Set the system suffix */ trunk/src/object2.c
r152 r155 372 372 /* Nearby objects start out "immune" */ 373 373 if ((cur_dis > 0) && (distance(py, px, y, x) < cur_dis) && 374 (k_ptr->squelch != SQUELCH_ALWAYS))374 (k_ptr->squelch != SQUELCH_ALWAYS)) 375 375 continue; 376 376 … … 788 788 /* Fully aware of the effects */ 789 789 k_info[o_ptr->k_idx].aware = TRUE; 790 790 791 791 /* Scrolls can change the graphics when becoming aware */ 792 792 if (o_ptr->tval == TV_SCROLL) trunk/src/save.c
r135 r155 412 412 * Write autoinscribe & squelch item-quality submenu to the savefile 413 413 */ 414 static void wr_squelch( )414 static void wr_squelch(void) 415 415 { 416 416 int i; trunk/src/spells2.c
r117 r155 247 247 248 248 /* 249 * If the object was squelched, keep analyzing250 * the same slot (the inventory was displaced). -DG-251 */249 * If the object was squelched, keep analyzing 250 * the same slot (the inventory was displaced). -DG- 251 */ 252 252 if (squelch != SQUELCH_YES || i < INVEN_WIELD) continue; 253 253 … … 3936 3936 else 3937 3937 { 3938 msg_format("On the ground: %s. %s", o_name,3938 msg_format("On the ground: %s. %s", o_name, 3939 3939 squelch_to_label(squelch)); 3940 3940 } … … 3942 3942 return (squelch); 3943 3943 } 3944 trunk/src/x-spell.c
r136 r155 16 16 /* 17 17 * The defines below must match the spell numbers in spell.txt 18 * if they don't, "interes sting" things will probably happen.18 * if they don't, "interesting" things will probably happen. 19 19 * 20 * It would be nice if we could get rid of this depend ancy20 * It would be nice if we could get rid of this dependency. 21 21 */ 22 23 22 #define SPELL_MAGIC_MISSILE 0 24 23 #define SPELL_DETECT_MONSTERS 1 trunk/src/z-form.c
r148 r155 818 818 quit(res); 819 819 } 820 821 822 823 /*824 * Vararg interface to core()825 */826 void core_fmt(cptr fmt, ...)827 {828 char *res;829 va_list vp;830 831 /* Begin the Varargs Stuff */832 va_start(vp, fmt);833 834 /* If requested, Do a virtual fprintf to stderr */835 res = vformat(fmt, vp);836 837 /* End the Varargs Stuff */838 va_end(vp);839 840 /* Call core() */841 core(res);842 }trunk/src/z-form.h
r1 r155 56 56 57 57 58 #endif 59 60 58 #endif /* INCLUDED_Z_FORM_H */ trunk/src/z-util.c
r148 r155 145 145 * Determine if string "a" is equal to string "b" 146 146 */ 147 #undef streq 147 148 bool streq(cptr a, cptr b) 148 149 { … … 229 230 (void)(exit(EXIT_FAILURE)); 230 231 } 231 232 233 234 /*235 * Redefinable "core" action236 */237 void (*core_aux)(cptr) = NULL;238 239 /*240 * Dump a core file, after printing a warning message241 * As with "quit()", try to use the "core_aux()" hook first.242 */243 void core(cptr str)244 {245 char *crash = NULL;246 247 /* Use the aux function */248 if (core_aux) (*core_aux)(str);249 250 /* Dump the warning string */251 if (str) plog(str);252 253 /* Attempt to Crash */254 (*crash) = (*crash);255 256 /* Be sure we exited */257 quit("core() failed");258 }259 260 261 262 trunk/src/z-util.h
r1 r155 31 31 extern void (*plog_aux)(cptr); 32 32 extern void (*quit_aux)(cptr); 33 extern void (*core_aux)(cptr);34 33 35 34 … … 51 50 extern bool suffix(cptr s, cptr t); 52 51 52 #define streq(s, t) (!strcmp(s, t)) 53 53 54 54 55 /* Print an error message */ … … 58 59 extern void quit(cptr str); 59 60 60 /* Dump core, with optional message */61 extern void core(cptr str);62 61 63 62 64 65 #endif 66 67 63 #endif /* INCLUDED_Z_UTIL_H */ trunk/src/z-virt.c
r148 r155 37 37 if (rpanic_aux) return ((*rpanic_aux)(len)); 38 38 39 /* Attempt to crashbefore icky things happen */39 /* Attempt to quit before icky things happen */ 40 40 quit("Out of Memory!"); 41 41
