version 1.65 | | version 1.66 |
---|
| | |
%{ | | %{ |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: loader.l,v 1.65 2005/08/29 20:18:06 akirschbaum Exp $"; | | * "$Id: loader.l,v 1.66 2005/08/31 20:07:22 tchize Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* NEVER touch buf between PREPARE_FASTCAT(buf) and | | * NEVER touch buf between PREPARE_FASTCAT(buf) and |
* FINISH_FASTCAT(buf) | | * FINISH_FASTCAT(buf) |
*/ | | */ |
| | static int already_run = 0; |
| | static int flag_lens[NUM_FLAGS]; |
static char buf2[HUGE_BUF]; | | static char buf2[HUGE_BUF]; |
static char buf[HUGE_BUF]; | | static char buf[HUGE_BUF]; |
char* fastbuf; | | char* fastbuf; |
| | |
key_value * my_field; | | key_value * my_field; |
key_value * arch_field; | | key_value * arch_field; |
| | |
| | /*first init this function if first call*/ |
| | if (!already_run){ |
| | for (i=0;i<NUM_FLAGS;i++) |
| | flag_lens[i]=flag_names[i]?strlen(flag_names[i]):0; /* some flags may be null? :/*/ |
| | already_run=1; |
| | } |
buf[0]='\0'; | | buf[0]='\0'; |
fastbuf=PREPARE_FASTCAT(buf); | | fastbuf=PREPARE_FASTCAT(buf); |
| | |
| | |
FAST_SAVE_LONG(fastbuf,"gen_sp_armour ",op->gen_sp_armour,14); | | FAST_SAVE_LONG(fastbuf,"gen_sp_armour ",op->gen_sp_armour,14); |
} | | } |
| | |
| | if (!COMPARE_FLAGS(op,op2)) |
for (tmp=0; tmp <= NUM_FLAGS; tmp++) { | | for (tmp=0; tmp <= NUM_FLAGS; tmp++) { |
if (flag_names[tmp] && (QUERY_FLAG(op, tmp) != QUERY_FLAG(op2, tmp))) { | | if (flag_names[tmp] && (QUERY_FLAG(op, tmp) != QUERY_FLAG(op2, tmp))) { |
ADD_STRINGLINE_ENTRY(fastbuf,flag_names[tmp],QUERY_FLAG(op, tmp)?" 1":" 0",strlen(flag_names[tmp])); | | ADD_STRINGLINE_ENTRY(fastbuf,flag_names[tmp],QUERY_FLAG(op, tmp)?" 1":" 0",flag_lens[tmp]); |
} | | } |
} | | } |
/* The old code was buggy - it would lose custom SLOW_PENALTY if the archetype | | /* The old code was buggy - it would lose custom SLOW_PENALTY if the archetype |