aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-24 01:58:15 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-24 01:58:15 +0200
commit4a952f22d779cdce27dbfc68a23a7d13d3e62c0d (patch)
treee9951cd312a946a3b47bbbfa424041b452aa1093 /src
parentf0819246702e3c25bc7bd354c0ed6f6520454b80 (diff)
downloadminetest-4a952f22d779cdce27dbfc68a23a7d13d3e62c0d.tar.gz
minetest-4a952f22d779cdce27dbfc68a23a7d13d3e62c0d.tar.bz2
minetest-4a952f22d779cdce27dbfc68a23a7d13d3e62c0d.zip
small fixes here and there
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp30
-rw-r--r--src/map.cpp36
-rw-r--r--src/mapblock.cpp2
-rw-r--r--src/mapnode.h6
-rw-r--r--src/server.cpp3
5 files changed, 31 insertions, 46 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f9b66ad02..7c5f6bf3e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2114,11 +2114,9 @@ int main(int argc, char *argv[])
camera_direction.rotateXZBy(camera_yaw);
// This is at the height of the eyes of the current figure
- v3f camera_position =
- player_position + v3f(0, BS+BS/2, 0);
+ v3f camera_position = player_position + v3f(0, BS+BS/2, 0);
// This is more like in minecraft
- /*v3f camera_position =
- player_position + v3f(0, BS+BS*0.65, 0);*/
+ //v3f camera_position = player_position + v3f(0, BS+BS*0.625, 0);
camera->setPosition(camera_position);
// *100.0 helps in large map coordinates
@@ -2828,29 +2826,7 @@ int main(int argc, char *argv[])
catch(con::PeerNotFoundException &e)
{
dstream<<DTIME<<"Connection timed out."<<std::endl;
-
- /*if(g_device)
- {
- GUIMessageMenu *menu =
- new GUIMessageMenu(guienv, guiroot, -1,
- &g_menumgr,
- L"Connection timed out");
-
- video::IVideoDriver* driver = g_device->getVideoDriver();
-
- dstream<<"Created menu"<<std::endl;
-
- while(g_device->run() && menu->getStatus() == false)
- {
- driver->beginScene(true, true, video::SColor(255,0,0,0));
- guienv->drawAll();
- driver->endScene();
- }
-
- dstream<<"Dropping menu"<<std::endl;
-
- menu->drop();
- }*/
+ error_message = L"Connection timed out.";
}
} // Menu-game loop
diff --git a/src/map.cpp b/src/map.cpp
index 973e12678..5655ee9ec 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1689,7 +1689,7 @@ ServerMap::ServerMap(std::string savedir, HMParams hmp, MapParams mp):
list_plants_amount->addPoint(p, Attribute(plants_amount));*/
float plants_amount = 0;
- if(myrand()%5 == 0)
+ if(myrand()%4 == 0)
{
plants_amount = 1.5;
}
@@ -2880,16 +2880,16 @@ continue_generating:
n.d = CONTENT_LEAVES;
- if(rand()%4!=0) sector->setNode(gp+v3s16(0,5,0), n);
+ if(myrand()%4!=0) sector->setNode(gp+v3s16(0,5,0), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(-1,5,0), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(1,5,0), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(0,5,-1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(0,5,1), n);
- /*if(rand()%3!=0) sector->setNode(gp+v3s16(1,5,1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(-1,5,1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(-1,5,-1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(1,5,-1), n);*/
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(-1,5,0), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(1,5,0), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(0,5,-1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(0,5,1), n);
+ /*if(myrand()%3!=0) sector->setNode(gp+v3s16(1,5,1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(-1,5,1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(-1,5,-1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(1,5,-1), n);*/
sector->setNode(gp+v3s16(0,4,0), n);
@@ -2911,14 +2911,14 @@ continue_generating:
sector->setNode(gp+v3s16(-1,3,-1), n);
sector->setNode(gp+v3s16(1,3,-1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(-1,2,0), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(1,2,0), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(0,2,-1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(0,2,1), n);
- /*if(rand()%3!=0) sector->setNode(gp+v3s16(1,2,1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(-1,2,1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(-1,2,-1), n);
- if(rand()%3!=0) sector->setNode(gp+v3s16(1,2,-1), n);*/
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(-1,2,0), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(1,2,0), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(0,2,-1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(0,2,1), n);
+ /*if(myrand()%3!=0) sector->setNode(gp+v3s16(1,2,1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(-1,2,1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(-1,2,-1), n);
+ if(myrand()%3!=0) sector->setNode(gp+v3s16(1,2,-1), n);*/
// Objects are identified by wanted position
objects_to_remove.push_back(p);
diff --git a/src/mapblock.cpp b/src/mapblock.cpp
index 5cfb60aa2..f18cb2fdd 100644
--- a/src/mapblock.cpp
+++ b/src/mapblock.cpp
@@ -969,6 +969,7 @@ void MapBlock::updateMesh(u32 daynight_ratio)
material.setFlag(video::EMF_LIGHTING, false);
material.setFlag(video::EMF_BACK_FACE_CULLING, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false);
+ material.setFlag(video::EMF_FOG_ENABLE, true);
material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
material.setTexture(0,
g_irrlicht->getTexture(porting::getDataPath("water.png").c_str()));
@@ -1005,6 +1006,7 @@ void MapBlock::updateMesh(u32 daynight_ratio)
material.setFlag(video::EMF_LIGHTING, false);
material.setFlag(video::EMF_BACK_FACE_CULLING, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false);
+ material.setFlag(video::EMF_FOG_ENABLE, true);
material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
material.setTexture(0,
g_irrlicht->getTexture(porting::getDataPath("water.png").c_str()));
diff --git a/src/mapnode.h b/src/mapnode.h
index e3b921a66..286edcc2b 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -211,6 +211,12 @@ inline u8 face_contents(u8 m1, u8 m2)
return 0;
bool contents_differ = (m1 != m2);
+
+ // Contents don't differ for different forms of same liquid
+ if(content_liquid(m1) && content_liquid(m2)
+ && make_liquid_flowing(m1) == make_liquid_flowing(m2))
+ contents_differ = false;
+
bool solidness_differs = (content_solidness(m1) != content_solidness(m2));
bool makes_face = contents_differ && solidness_differs;
diff --git a/src/server.cpp b/src/server.cpp
index a979086ea..65e390345 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -3406,7 +3406,8 @@ void Server::handlePeerChange(PeerChange &c)
// Set player client disconnected
{
Player *player = m_env.getPlayer(c.peer_id);
- player->peer_id = 0;
+ if(player != NULL)
+ player->peer_id = 0;
}
// Delete client