From: Christian Heller Date: Wed, 21 Aug 2013 02:50:48 +0000 (+0200) Subject: Minor refactoring of save_game(). X-Git-Tag: tce~1088 X-Git-Url: https://plomlompom.com/repos/index.html?a=commitdiff_plain;h=922021e2cd00437584ba5138c980a62e0ac3f984;p=plomrogue Minor refactoring of save_game(). --- diff --git a/src/misc.c b/src/misc.c index 8833252..dac4c97 100644 --- a/src/misc.c +++ b/src/misc.c @@ -133,13 +133,12 @@ extern void turn_over(struct World * world, char action) extern void save_game(struct World * world) { - uint8_t err = 0; char * err_msg = "Error saving game."; FILE * file = fopen("savefile", "w"); - // err = (0 == file); exit_err(0 == file, world, err_msg); + uint8_t err; err = write_uint32_bigendian(world->seed, file); err = err | write_uint32_bigendian(world->turn, file); err = err | write_uint16_bigendian(world->player->pos.y + 1, file);