small fixes here and there

master
Perttu Ahola 2011-01-24 01:58:15 +02:00
parent f081924670
commit 4a952f22d7
5 changed files with 31 additions and 46 deletions

View File

@ -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

View File

@ -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);

View File

@ -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()));

View File

@ -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;

View File

@ -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