QTfrontend/ui/page/pageeditteam.cpp
changeset 12674 bc34fc75670e
parent 12510 82c75a317d48
child 12675 967990d958bc
--- a/QTfrontend/ui/page/pageeditteam.cpp	Sat Oct 07 13:23:58 2017 -0400
+++ b/QTfrontend/ui/page/pageeditteam.cpp	Sat Oct 07 20:07:21 2017 +0200
@@ -436,6 +436,7 @@
 {
     m_playerHash = playerHash;
     lazyLoad();
+    OldTeamName = name;
 
     // Mostly create a default team, with 2 important exceptions:
     HWTeam newTeam(name);
@@ -452,6 +453,7 @@
 {
     m_playerHash = playerHash;
     lazyLoad();
+    OldTeamName = name;
 
     HWTeam team(name);
     team.loadFromFile();
@@ -576,7 +578,8 @@
 
 HWTeam PageEditTeam::data()
 {
-    HWTeam team(TeamNameEdit->text());
+    HWTeam team(OldTeamName);
+    team.setName(TeamNameEdit->text());
     team.setDifficulty(CBTeamLvl->currentIndex());
 
     for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++)