version 1.71 | | version 1.72 |
---|
| | |
/* | | /* |
* static char *rcsid_map_c = | | * static char *rcsid_map_c = |
* "$Id: map.c,v 1.71 2005/03/15 21:06:19 ryo_saeba Exp $"; | | * "$Id: map.c,v 1.72 2005/03/19 08:35:08 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
continue; | | continue; |
} | | } |
} /* if check_inv */ | | } /* if check_inv */ |
else if (QUERY_FLAG(tmp,FLAG_NO_PASS) || (QUERY_FLAG(tmp,FLAG_ALIVE) && | | else { |
tmp->head != ob && tmp != ob && tmp->type != DOOR) &&
| | /* Broke apart a big nasty if into several here to make |
!(QUERY_FLAG(tmp,FLAG_WIZ) && tmp->contr->hidden))
| | * this more readable. first check - if the space blocks |
| | * movement, can't move here. |
| | * second - if a monster, can't move there, unles it is a |
| | * hidden dm |
| | */ |
| | if (QUERY_FLAG(tmp,FLAG_NO_PASS)) return 1; |
| | if (QUERY_FLAG(tmp,FLAG_ALIVE) && tmp->head != ob && tmp != ob && |
| | tmp->type != DOOR && !(QUERY_FLAG(tmp,FLAG_WIZ) && tmp->contr->hidden)) |
return 1; | | return 1; |
| | } |
| | |
} | | } |
return 0; | | return 0; |
| | |
while (isspace(*value)) value++; | | while (isspace(*value)) value++; |
end = strchr(value, '\n'); | | end = strchr(value, '\n'); |
} | | } |
| | if (!end) { |
| | LOG(llevError, "Error loading map header - did not find a newline - perhaps file is truncated? Buf=%s\n", |
| | buf); |
| | return 1; |
| | } |
| | |
| | |
/* key is the field name, value is what it should be set | | /* key is the field name, value is what it should be set |
* to. We've already done the work to null terminate key, | | * to. We've already done the work to null terminate key, |
| | |
* or a difficulty value we generated when the map was first loaded | | * or a difficulty value we generated when the map was first loaded |
*/ | | */ |
if (m->difficulty) fprintf(fp,"difficulty %d\n", m->difficulty); | | if (m->difficulty) fprintf(fp,"difficulty %d\n", m->difficulty); |
if (m->region) fprintf(fp,"region %d\n", m->region); | | if (m->region) fprintf(fp,"region %s\n", m->region->name); |
if (m->darkness) fprintf(fp,"darkness %d\n", m->darkness); | | if (m->darkness) fprintf(fp,"darkness %d\n", m->darkness); |
if (m->width) fprintf(fp,"width %d\n", m->width); | | if (m->width) fprintf(fp,"width %d\n", m->width); |
if (m->height) fprintf(fp,"height %d\n", m->height); | | if (m->height) fprintf(fp,"height %d\n", m->height); |