From 8c01ea4d4238988ff3973db8ca0ca349e67d0746 Mon Sep 17 00:00:00 2001 From: BevapDin <Tho_Ki@gmx.de> Date: Fri, 22 Nov 2019 23:37:01 +0100 Subject: [PATCH] Deduplicate code and call the proper function instead. The function contains character-by-character the same. --- src/savegame.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/savegame.cpp b/src/savegame.cpp index 282ee845dcfc7..9f9fd9a0ef8c6 100644 --- a/src/savegame.cpp +++ b/src/savegame.cpp @@ -149,18 +149,7 @@ static void chkversion( std::istream &fin ) */ void game::unserialize( std::istream &fin ) { - if( fin.peek() == '#' ) { - std::string vline; - getline( fin, vline ); - std::string tmphash; - std::string tmpver; - int savedver = -1; - std::stringstream vliness( vline ); - vliness >> tmphash >> tmpver >> savedver; - if( tmpver == "version" && savedver != -1 ) { - savegame_loading_version = savedver; - } - } + chkversion( fin ); std::string linebuf; int tmpturn = 0;