From 261f46b0b5eb185f45e182205006ef098f2da0c9 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Thu, 5 Jan 2023 15:04:18 -0500 Subject: [PATCH] This avoids an extra iteration that can cause test failures --- src/universe/pc.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/universe/pc.cpp b/src/universe/pc.cpp index 40d75930..1868ad03 100644 --- a/src/universe/pc.cpp +++ b/src/universe/pc.cpp @@ -1255,8 +1255,7 @@ void cPlayer::readFrom(std::istream& file){ skills.clear(); cur_sp = max_sp = ap = 0; - while(bin) { // continue as long as no error, such as eof, occurs - getline(bin, cur); + while(getline(bin, cur)) { // continue as long as no error, such as eof, occurs sin.str(cur); sin >> cur; if(cur == "STATUS"){ @@ -1338,8 +1337,7 @@ void cPlayer::readFrom(std::istream& file){ sin.clear(); } bin.clear(); - while(file) { - getline(file, cur, '\f'); + while(getline(file, cur, '\f')) { bin.str(cur); bin >> cur; if(cur == "ITEM") {