diff options
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/server.cpp b/src/server.cpp index 6c008a2a1..0aba2796c 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3194,19 +3194,7 @@ u32 Server::addParticleSpawner(u16 amount, float spawntime, peer_id = player->peer_id; } - u32 id = 0; - for(;;) // look for unused particlespawner id - { - id++; - if (std::find(m_particlespawner_ids.begin(), - m_particlespawner_ids.end(), id) - == m_particlespawner_ids.end()) - { - m_particlespawner_ids.push_back(id); - break; - } - } - + u32 id = m_env->addParticleSpawner(spawntime); SendAddParticleSpawner(peer_id, amount, spawntime, minpos, maxpos, minvel, maxvel, minacc, maxacc, minexptime, maxexptime, minsize, maxsize, @@ -3229,13 +3217,16 @@ void Server::deleteParticleSpawner(const std::string &playername, u32 id) peer_id = player->peer_id; } - m_particlespawner_ids.erase( - std::remove(m_particlespawner_ids.begin(), - m_particlespawner_ids.end(), id), - m_particlespawner_ids.end()); + m_env->deleteParticleSpawner(id); SendDeleteParticleSpawner(peer_id, id); } +void Server::deleteParticleSpawnerAll(u32 id) +{ + m_env->deleteParticleSpawner(id); + SendDeleteParticleSpawner(PEER_ID_INEXISTENT, id); +} + Inventory* Server::createDetachedInventory(const std::string &name) { if(m_detached_inventories.count(name) > 0){ |