projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a74727
)
Make core.get_favorites("local") ignore duplicates (#7926)
author
Paul Ouellette
<oue.paul18@gmail.com>
Fri, 8 Nov 2019 21:18:20 +0000
(16:18 -0500)
committer
SmallJoker
<SmallJoker@users.noreply.github.com>
Fri, 8 Nov 2019 21:18:20 +0000
(22:18 +0100)
src/serverlist.cpp
patch
|
blob
|
history
diff --git
a/src/serverlist.cpp
b/src/serverlist.cpp
index 7d3ab4bbb568370934649cad2d6c574875a7234f..18264e933cce2f8f5e0032b1f00d10b9668f7c58 100644
(file)
--- a/
src/serverlist.cpp
+++ b/
src/serverlist.cpp
@@
-155,6
+155,16
@@
std::vector<ServerListSpec> deSerialize(const std::string &liststring)
server["address"] = tmp;
std::getline(stream, tmp);
server["port"] = tmp;
+ bool unique = true;
+ for (const ServerListSpec &added : serverlist) {
+ if (server["name"] == added["name"]
+ && server["port"] == added["port"]) {
+ unique = false;
+ break;
+ }
+ }
+ if (!unique)
+ continue;
std::getline(stream, tmp);
server["description"] = tmp;
serverlist.push_back(server);