diff --git a/src/mon/MonMap.h b/src/mon/MonMap.h index 77f17b230b6..f2f6c6439c2 100644 --- a/src/mon/MonMap.h +++ b/src/mon/MonMap.h @@ -103,6 +103,14 @@ class MonMap { calc_ranks(); } + void rename(string oldname, string newname) { + assert(contains(oldname)); + assert(!contains(newname)); + mon_addr[newname] = mon_addr[oldname]; + mon_addr.erase(oldname); + calc_ranks(); + } + bool contains(const string& name) { return mon_addr.count(name); } @@ -147,14 +155,6 @@ class MonMap { return true; } - void rename(string oldname, string newname) { - assert(contains(oldname)); - assert(!contains(newname)); - mon_addr[newname] = mon_addr[oldname]; - mon_addr.erase(oldname); - addr_name[mon_addr[newname]] = newname; - } - const entity_addr_t& get_addr(const string& n) { assert(mon_addr.count(n)); return mon_addr[n];