Browse Source

usage of new hashmap iterators

Kajetan Johannes Hammerle 2 years ago
parent
commit
a5c0707220
2 changed files with 6 additions and 6 deletions
  1. 4 4
      input/Buttons.cpp
  2. 2 2
      network/Server.cpp

+ 4 - 4
input/Buttons.cpp

@@ -35,11 +35,11 @@ void Buttons::tick() {
     if(searchForGamepad()) {
         checkGamepad();
     }
-    for(auto& e : buttons) {
-        e.value->tick();
+    for(Button* b : buttons.values()) {
+        b->tick();
     }
-    for(auto& e : mouseButtons) {
-        e.value->tick();
+    for(Button* b : mouseButtons.values()) {
+        b->tick();
     }
     lastMouseX = mouseX;
     lastMouseY = mouseY;

+ 2 - 2
network/Server.cpp

@@ -40,8 +40,8 @@ Server::Server() : server(nullptr), idCounter(1) {
 }
 
 Server::~Server() {
-    for(auto& client : clients) {
-        enet_peer_reset(client.value.peer);
+    for(Client& client : clients.values()) {
+        enet_peer_reset(client.peer);
     }
     enet_host_destroy(server);
     ENet::remove();