summaryrefslogtreecommitdiff
path: root/src/network/clientpackethandler.cpp
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2019-02-26 04:26:25 +0000
committerGitHub <noreply@github.com>2019-02-26 04:26:25 +0000
commit01cd63bd3bca0192dab2834faf414b022706a77e (patch)
tree0e735b1555ceee05360600b380d30429239e9609 /src/network/clientpackethandler.cpp
parentd80186d8571261ad7d09d3498a9e8a6da63801a2 (diff)
downloadminetest-01cd63bd3bca0192dab2834faf414b022706a77e.tar.gz
minetest-01cd63bd3bca0192dab2834faf414b022706a77e.tar.bz2
minetest-01cd63bd3bca0192dab2834faf414b022706a77e.zip
Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)
Reverts 5dab7426451842793b183fbd961ad2ae83c8acbd "[CSM] Add functions to create particles and particlespawners."
Diffstat (limited to 'src/network/clientpackethandler.cpp')
-rw-r--r--src/network/clientpackethandler.cpp22
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);
}