Mass: fix another bug with importing.

This commit is contained in:
Guillaume Jacquemin 2021-10-14 15:06:03 +02:00
parent dd460b4313
commit b92c37e4b6
1 changed files with 3 additions and 9 deletions

View File

@ -864,19 +864,13 @@ auto Mass::writeGlobalStyle(UnsignedLong index) -> bool {
auto Mass::updateSteamId(const std::string& steam_id) -> bool { auto Mass::updateSteamId(const std::string& steam_id) -> bool {
_steamId = steam_id; _steamId = steam_id;
auto unit_data = _mass->at<GenericStructProperty>("UnitData"); auto account = _mass->at<StringProperty>("Account");
if(!unit_data) { if(!account) {
_state = State::Invalid; _state = State::Invalid;
return false; return false;
} }
auto account_prop = unit_data->at<StringProperty>("Account"); account->value = steam_id;
if(!account_prop) {
_state = State::Invalid;
return false;
}
account_prop->value = steam_id;
return _mass->saveToFile(); return _mass->saveToFile();
} }