home · contact · privacy
Minor refactoring of save_game().
authorChristian Heller <c.heller@plomlompom.de>
Wed, 21 Aug 2013 02:50:48 +0000 (04:50 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 21 Aug 2013 02:50:48 +0000 (04:50 +0200)
src/misc.c

index 883325289475b850a3814c213262a262806bb645..dac4c974f07767228510e4444583a02be3f43d38 100644 (file)
@@ -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);