diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/clientpackethandler.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 2d02d0755..3fadc3cb0 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -977,7 +977,7 @@ void Client::handleCommand_AddParticleSpawner(NetworkPacket* pkt) float minsize; float maxsize; bool collisiondetection; - u32 server_id; + u32 id; *pkt >> amount >> spawntime >> minpos >> maxpos >> minvel >> maxvel >> minacc >> maxacc >> minexptime >> maxexptime >> minsize @@ -985,7 +985,7 @@ void Client::handleCommand_AddParticleSpawner(NetworkPacket* pkt) std::string texture = pkt->readLongString(); - *pkt >> server_id; + *pkt >> id; bool vertical = false; bool collision_removal = false; @@ -1007,9 +1007,6 @@ 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(); event->type = CE_ADD_PARTICLESPAWNER; event->add_particlespawner.amount = amount; @@ -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 = id; event->add_particlespawner.animation = animation; event->add_particlespawner.glow = glow; @@ -1040,19 +1037,12 @@ void Client::handleCommand_AddParticleSpawner(NetworkPacket* pkt) 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; + u32 id; + *pkt >> id; ClientEvent *event = new ClientEvent(); event->type = CE_DELETE_PARTICLESPAWNER; - event->delete_particlespawner.id = client_id; + event->delete_particlespawner.id = id; m_client_event_queue.push(event); } |