Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/pips
22 changes: 17 additions & 5 deletions rummy/deck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,25 @@ void Deck::CompileStream(std::istream &ss, std::map<std::string, CardMeta> &meta
local_name = local_name.substr(dot_pos + 1, std::string::npos);
std::replace(suit_name.begin(), suit_name.end(), '.', '/');
curr_suit = suit_name;
name_prefix = suit_name + ".";
}
} else {
std::string suit_card_name = curr_suit;
std::replace(suit_card_name.begin(), suit_card_name.end(), '/', '.');
// use suit name as prefix
name_prefix = suit_card_name + ".";
global_name = name_prefix + local_name;
// standalone variable needs to reset curr_suit
if (local_name.find('.') != std::string::npos) {
auto dot_pos = local_name.find_last_of('.');
std::string suit_name = local_name.substr(0, dot_pos);
local_name = local_name.substr(dot_pos + 1, std::string::npos);
std::replace(suit_name.begin(), suit_name.end(), '.', '/');
name_prefix = suit_name + ".";
global_name = name_prefix + local_name;
curr_suit = suit_name;
} else {
std::string suit_card_name = curr_suit;
std::replace(suit_card_name.begin(), suit_card_name.end(), '/', '.');
// use suit name as prefix
name_prefix = suit_card_name + ".";
global_name = name_prefix + local_name;
}
}

// Variable updates
Expand Down
Loading