From 30af43ae9581045ac1d5a570ef74dfba194d0ee4 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Wed, 7 Jan 2015 13:25:16 +0000 Subject: [PATCH] Fix walls in strings and move constructor --- source/ttrts/formatters.cpp | 2 +- source/ttrts/game.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ttrts/formatters.cpp b/source/ttrts/formatters.cpp index 6d6d03a..332c5ac 100644 --- a/source/ttrts/formatters.cpp +++ b/source/ttrts/formatters.cpp @@ -92,7 +92,7 @@ CTTRTSGame GetGameFromString( const std::string& input ) size_t pos; while ( ( pos = walls_str.find(']') ) != std::string::npos ) { - std::string pos_string = walls_str.substr(0,pos); + std::string pos_string = walls_str.substr(0,pos+1); // Use scanf to extract positions diff --git a/source/ttrts/game.cpp b/source/ttrts/game.cpp index 96800d5..d649060 100644 --- a/source/ttrts/game.cpp +++ b/source/ttrts/game.cpp @@ -17,6 +17,7 @@ CTTRTSGame::CTTRTSGame(CTTRTSGame&& game) , dimensions(std::move(game.dimensions)) , turn(std::move(game.turn)) , name(std::move(game.name)) +, m_walls(std::move(game.m_walls)) { }