aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/clientpackethandler.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index 2d02d0755..3e50173a6 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -1007,10 +1007,7 @@ void Client::handleCommand_AddParticleSpawner(NetworkPacket* pkt)
object_collision = readU8(is);
} catch (...) {}
- u32 client_id = m_particle_manager.getSpawnerId();
- m_particles_server_to_client[server_id] = client_id;
-
- ClientEvent *event = new ClientEvent();
+ auto event = new ClientEvent();
event->type = CE_ADD_PARTICLESPAWNER;
event->add_particlespawner.amount = amount;
event->add_particlespawner.spawntime = spawntime;
@@ -1030,7 +1027,7 @@ void Client::handleCommand_AddParticleSpawner(NetworkPacket* pkt)
event->add_particlespawner.attached_id = attached_id;
event->add_particlespawner.vertical = vertical;
event->add_particlespawner.texture = new std::string(texture);
- event->add_particlespawner.id = client_id;
+ event->add_particlespawner.id = server_id;
event->add_particlespawner.animation = animation;
event->add_particlespawner.glow = glow;
@@ -1043,16 +1040,9 @@ void Client::handleCommand_DeleteParticleSpawner(NetworkPacket* pkt)
u32 server_id;
*pkt >> server_id;
- u32 client_id;
- auto i = m_particles_server_to_client.find(server_id);
- if (i != m_particles_server_to_client.end())
- client_id = i->second;
- else
- return;
-
ClientEvent *event = new ClientEvent();
event->type = CE_DELETE_PARTICLESPAWNER;
- event->delete_particlespawner.id = client_id;
+ event->delete_particlespawner.id = server_id;
m_client_event_queue.push(event);
}