assorted tweaks

This commit is contained in:
darkrose 2017-09-02 21:38:27 +10:00
parent 58f14f3ae2
commit 451865ac69
6 changed files with 28 additions and 13 deletions

View File

@ -152,6 +152,7 @@ void config_default_init()
config_set_default("world.game.environment.footprints","true",NULL);
config_set_default("world.game.environment.fire.spread","false",NULL);
config_set_default("world.game.environment.time.speed","96",NULL);
config_set_default("world.game.environment.season","auto",NULL);
config_set_default("world.game.motd","",NULL);
config_set_default("world.map.type","default",NULL);

View File

@ -3057,6 +3057,7 @@ void ServerEnvironment::step(float dtime)
if (
coldzone
&& biome != BIOME_BEACH
&& (
content_features(n).draw_type == CDT_CUBELIKE
|| content_features(n).draw_type == CDT_GLASSLIKE
@ -4538,7 +4539,6 @@ u16 ClientEnvironment::addActiveObject(ClientActiveObject *object)
void ClientEnvironment::addActiveObject(u16 id, u8 type, const std::string &init_data)
{
// TODO: convert old to new
ClientActiveObject* obj = ClientActiveObject::create(type);
if (obj == NULL) {
infostream<<"ClientEnvironment::addActiveObject(): "

View File

@ -37,6 +37,8 @@
- etc.
*/
#include "common.h"
#include <list>
#include <map>
#include <set>
@ -198,6 +200,17 @@ public:
u32 getSeason()
{
char* s = config_get("world.game.environment.season");
if (s) {
if (!strcmp(s,"summer"))
return ENV_SEASON_SUMMER;
if (!strcmp(s,"autumn") || !strcmp(s,"fall"))
return ENV_SEASON_AUTUMN;
if (!strcmp(s,"winter"))
return ENV_SEASON_WINTER;
if (!strcmp(s,"spring"))
return ENV_SEASON_SPRING;
}
return (m_time%240)/60;
}

View File

@ -500,6 +500,9 @@ void MapBlockMesh::animate(float time)
m_animation_data[it->first].frame = frame;
u16 mc = m_mesh->getMeshBufferCount();
if (mc <= it->first)
continue;
scene::IMeshBuffer *buf = m_mesh->getMeshBuffer(it->first);
// Create new texture name from original
@ -536,7 +539,7 @@ void MapBlockMesh::generate(MeshMakeData *data, v3s16 camera_offset, JMutex *mut
#if USE_AUDIO == 1
{
if (data->m_sounds != NULL) {
std::string snd = content_features(n).sound_ambient;
std::map<v3s16,MapBlockSound>::iterator i = data->m_sounds->find(p);
if (snd != "") {
@ -730,9 +733,9 @@ void MapBlockMesh::generate(MeshMakeData *data, v3s16 camera_offset, JMutex *mut
if (mutex != NULL)
mutex->Lock();
if (m_mesh)
if (m_mesh != NULL)
m_mesh->drop();
if (m_farmesh)
if (m_farmesh != NULL)
m_farmesh->drop();
m_mesh = mesh;
m_farmesh = fmesh;

View File

@ -608,22 +608,22 @@ void plantgrowth_grass(ServerEnvironment *env, v3s16 p0)
u8 p = n.param2&0xF0;
if ((p&(1<<7)) == 0) {
MapNode nn = env->getMap().getNodeNoEx(p0+v3s16(0,0,-1));
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask)
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask && nn.param2 == 0)
p |= 1<<7;
}
if ((p&(1<<6)) == 0) {
MapNode nn = env->getMap().getNodeNoEx(p0+v3s16(0,0,1));
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask)
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask && nn.param2 == 0)
p |= 1<<6;
}
if ((p&(1<<5)) == 0) {
MapNode nn = env->getMap().getNodeNoEx(p0+v3s16(-1,0,0));
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask)
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask && nn.param2 == 0)
p |= 1<<5;
}
if ((p&(1<<4)) == 0) {
MapNode nn = env->getMap().getNodeNoEx(p0+v3s16(1,0,0));
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask)
if (nn.getContent() == c && (nn.param1&0x0F) == p1mask && nn.param2 == 0)
p |= 1<<4;
}
if (!n.param2 && p == 0 && myrand_range(0,20) != 0)

View File

@ -72,8 +72,7 @@ void TextureSource::processQueue()
/*
Fetch textures
*/
if(m_get_texture_queue.size() > 0)
{
if (m_get_texture_queue.size() > 0) {
GetRequest<std::string, u32, u8, u8>
request = m_get_texture_queue.pop();
@ -82,12 +81,11 @@ void TextureSource::processQueue()
<<"name=\""<<request.key<<"\""
<<std::endl;
GetResult<std::string, u32, u8, u8>
result;
GetResult<std::string, u32, u8, u8> result;
result.key = request.key;
result.callers = request.callers;
result.item = getTextureIdDirect(request.key);
/* TODO: segv right about here */
request.dest->push_back(result);
}
}