* `minetest.add_particlespawner(particlespawner definition)`
* Add a `ParticleSpawner`, an object that spawns an amount of particles over `time` seconds
- * Returns an `id`
+ * Returns an `id`, and -1 if adding didn't succeed
* `Deprecated: minetest.add_particlespawner(amount, time,
minpos, maxpos,
minvel, maxvel,
void Server::notifyPlayer(const char *name, const std::wstring &msg)
{
+ // m_env will be NULL if the server is initializing
+ if (!m_env)
+ return;
+
Player *player = m_env->getPlayer(name);
if (!player)
return;
bool Server::showFormspec(const char *playername, const std::string &formspec,
const std::string &formname)
{
+ // m_env will be NULL if the server is initializing
+ if (!m_env)
+ return false;
+
Player *player = m_env->getPlayer(playername);
if (!player)
return false;
float expirationtime, float size, bool
collisiondetection, bool vertical, const std::string &texture)
{
+ // m_env will be NULL if the server is initializing
+ if (!m_env)
+ return;
+
u16 peer_id = PEER_ID_INEXISTENT;
if (playername != "") {
Player* player = m_env->getPlayer(playername.c_str());
bool collisiondetection, bool vertical, const std::string &texture,
const std::string &playername)
{
+ // m_env will be NULL if the server is initializing
+ if (!m_env)
+ return -1;
+
u16 peer_id = PEER_ID_INEXISTENT;
if (playername != "") {
Player* player = m_env->getPlayer(playername.c_str());
void Server::deleteParticleSpawner(const std::string &playername, u32 id)
{
+ // m_env will be NULL if the server is initializing
+ if (!m_env)
+ throw ServerError("Can't delete particle spawners during initialisation!");
+
u16 peer_id = PEER_ID_INEXISTENT;
if (playername != "") {
Player* player = m_env->getPlayer(playername.c_str());