version 1.51 | | version 1.52 |
---|
| | |
/* A lexical scanner generated by flex */ | | /* A lexical scanner generated by flex */ |
| | |
/* Scanner skeleton version: | | /* Scanner skeleton version: |
* $Header: /cvsroot/crossfire/crossfire/common/loader.c,v 1.51 2003/09/23 05:21:26 mwedel Exp $ | | * $Header: /cvsroot/crossfire/crossfire/common/loader.c,v 1.52 2003/09/23 07:13:34 mwedel Exp $ |
*/ | | */ |
| | |
#define FLEX_SCANNER | | #define FLEX_SCANNER |
| | |
#line 2 "loader.l" | | #line 2 "loader.l" |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: loader.c,v 1.51 2003/09/23 05:21:26 mwedel Exp $"; | | * "$Id: loader.c,v 1.52 2003/09/23 07:13:34 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* the different values will be taken from. This function is | | * the different values will be taken from. This function is |
* typically used to dump objects (op2=empty object), or to save objects | | * typically used to dump objects (op2=empty object), or to save objects |
* (op2 is the objects original archetype) | | * (op2 is the objects original archetype) |
| | * Note by MSW 2003-09-22: It's a bug that we need to pass entrysize - |
| | * we should use strlen entryname instead. Any smart compiler should |
| | * optimize that out. |
*/ | | */ |
| | |
| | |
| | |
ADD_STRINGLINE_ENTRY(fastbuf,"slaying ",op->slaying,8); | | ADD_STRINGLINE_ENTRY(fastbuf,"slaying ",op->slaying,8); |
} | | } |
if(op->skill && op->skill!=op2->skill) { | | if(op->skill && op->skill!=op2->skill) { |
sprintf(buf2,"skill %s\n",op->skill); | | ADD_STRINGLINE_ENTRY(fastbuf,"skill ",op->skill,6); |
strcat(buf,buf2); | | |
} | | } |
if(op->msg && op->msg!=op2->msg) { | | if(op->msg && op->msg!=op2->msg) { |
FAST_STRNCAT(fastbuf,"msg\n",3+eol_size); | | FAST_STRNCAT(fastbuf,"msg\n",3+eol_size); |
| | |
FAST_SAVE_LONG(fastbuf,"grace ",op->stats.grace,6); | | FAST_SAVE_LONG(fastbuf,"grace ",op->stats.grace,6); |
if(op->stats.maxgrace!=op2->stats.maxgrace) | | if(op->stats.maxgrace!=op2->stats.maxgrace) |
FAST_SAVE_LONG(fastbuf,"maxgrace ",op->stats.maxgrace,9); | | FAST_SAVE_LONG(fastbuf,"maxgrace ",op->stats.maxgrace,9); |
if(op->stats.exp!=op2->stats.exp) | | |
FAST_SAVE_LONG(fastbuf,"exp ",op->stats.exp,4); | | if(op->stats.exp!=op2->stats.exp) { |
if(op->perm_exp!=op2->perm_exp) | | sprintf(buf2,"%lld\n", op->stats.exp); |
FAST_SAVE_LONG(fastbuf,"perm_exp ",op->perm_exp,4); | | ADD_STRINGLINE_ENTRY(fastbuf,"exp ", buf2, 4); |
| | } |
| | |
| | if(op->perm_exp!=op2->perm_exp) { |
| | sprintf(buf2,"%lld\n", op->perm_exp); |
| | ADD_STRINGLINE_ENTRY(fastbuf,"perm_exp ", buf2, 9); |
| | } |
| | |
if(op->expmul!=op2->expmul) | | if(op->expmul!=op2->expmul) |
FAST_SAVE_DOUBLE(fastbuf,"expmul ",op->expmul,7); | | FAST_SAVE_DOUBLE(fastbuf,"expmul ",op->expmul,7); |
if(op->stats.food!=op2->stats.food) | | if(op->stats.food!=op2->stats.food) |
| | |
FAST_SAVE_LONG(fastbuf,"item_power ",op->item_power,11); | | FAST_SAVE_LONG(fastbuf,"item_power ",op->item_power,11); |
} | | } |
| | |
if (op->duration != op2->duration) { | | if (op->duration != op2->duration) |
sprintf(buf2,"duration %d\n", op->duration); | | FAST_SAVE_LONG(fastbuf,"duration ",op->duration,9); |
strcat(buf,buf2); | | |
} | | |
| | |
if (op->range != op2->range) { | | if (op->range != op2->range) |
sprintf(buf2,"range %d\n", op->range); | | FAST_SAVE_LONG(fastbuf,"range ",op->range,6); |
strcat(buf,buf2); | | |
} | | |
| | |
if (op->range_modifier != op2->range_modifier) { | | if (op->range_modifier != op2->range_modifier) |
sprintf(buf2,"range_modifier %d\n", op->range_modifier); | | FAST_SAVE_LONG(fastbuf,"range_modifier ",op->range_modifier,15); |
strcat(buf,buf2); | | |
} | | |
| | |
if (op->duration_modifier != op2->duration_modifier) { | | if (op->duration_modifier != op2->duration_modifier) |
sprintf(buf2,"range_modifier %d\n", op->duration_modifier); | | FAST_SAVE_LONG(fastbuf,"duration_modifier ", op->duration_modifier,19); |
strcat(buf,buf2); | | |
} | | |
| | |
if (op->dam_modifier != op2->dam_modifier) { | | if (op->dam_modifier != op2->dam_modifier) |
sprintf(buf2,"dam_modifier %d\n", op->dam_modifier); | | FAST_SAVE_LONG(fastbuf,"dam_modifier ", op->dam_modifier,14); |
strcat(buf,buf2); | | |
} | | |
| | |
if (op->gen_sp_armour != op2->gen_sp_armour) { | | if (op->gen_sp_armour != op2->gen_sp_armour) { |
FAST_SAVE_LONG(fastbuf,"gen_sp_armour ",op->gen_sp_armour,14); | | FAST_SAVE_LONG(fastbuf,"gen_sp_armour ",op->gen_sp_armour,14); |