#include "cleanup.h" /* set_cleanup_flag() */
#include "field_of_view.h" /* VISIBLE */
#include "hardcoded_strings.h" /* s */
-#include "map.h" /* yx_to_map_pos() */
#include "things.h" /* Thing, ThingType, ThingAction, get_thing_type(),
* get_player()
*/
{
write_thing(file, o);
}
- write_key_value(file, s[S_CMD_THING], t->id);
+ write_key_value(file, s[S_CMD_T_ID], t->id);
write_key_value(file, s[S_CMD_T_TYPE], t->type);
write_key_value(file, s[S_CMD_T_POSY], t->pos.y);
write_key_value(file, s[S_CMD_T_POSX], t->pos.x);
{
for (t = world.things; t != 0; t = t->next)
{
- if ( player->fov_map[yx_to_map_pos(&t->pos)] & VISIBLE
+ if ( ( player->fov_map[t->pos.y * world.map.length +t->pos.x]
+ & VISIBLE)
&& ( (0 == i && 0 == t->lifepoints)
|| (1 == i && 0 < t->lifepoints)))
{
tt = get_thing_type(t->type);
c = tt->char_on_map;
- visible_map[yx_to_map_pos(&t->pos)] = c;
+ visible_map[t->pos.y * world.map.length + t->pos.x] = c;
}
}
}
struct ThingAction * ta;
for (ta = world.thing_actions; ta; ta = ta->next)
{
- write_key_value(file, s[S_CMD_THINGACTION], ta->id);
+ write_key_value(file, s[S_CMD_TA_ID], ta->id);
write_key_value(file, s[S_CMD_TA_EFFORT], ta->effort);
write_key_string(file, s[S_CMD_TA_NAME], ta->name);
try_fputc('\n', file, __func__);
struct ThingType * tt;
for (tt = world.thing_types; tt; tt = tt->next)
{
- write_key_value(file, s[S_CMD_THINGTYPE], tt->id);
+ write_key_value(file, s[S_CMD_TT_ID], tt->id);
write_key_value(file, s[S_CMD_TT_STARTN], tt->start_n);
write_key_value(file, s[S_CMD_TT_HP], tt->lifepoints);
int test = fprintf(file, "%s %c\n", s[S_CMD_TT_SYMB], tt->char_on_map);
}
for (tt = world.thing_types; tt; tt = tt->next)
{
- write_key_value(file, s[S_CMD_THINGTYPE], tt->id);
+ write_key_value(file, s[S_CMD_TT_ID], tt->id);
write_key_value(file, s[S_CMD_TT_CORPS], tt->corpse_id);
}
try_fputc('\n', file, __func__);