I call the "the Menche fixes"

This commit is contained in:
darkrose 2014-10-25 16:51:08 +10:00
parent 038dc0be98
commit 9a60343ed2
3 changed files with 26 additions and 10 deletions

View File

@ -361,6 +361,16 @@ void MobSAO::step(float dtime, bool send_recommended)
return;
}
/* if it isn't a swimmer, kill it in liquid */
if (m.motion_type != MMT_SWIM) {
v3s16 p = floatToInt(m_base_position,BS);
MapNode n = m_env->getMap().getNodeNoEx(p);
if (content_features(n).liquid_type != LIQUID_NONE) {
m_removed = true;
return;
}
}
if (m.special_dropped_max > 0 && m_special_count < m.special_dropped_max && myrand_range(0,50) == 0)
m_special_count++;

View File

@ -79,6 +79,9 @@ DiggingProperties getDiggingProperties(content_t content, content_t tool)
time *= 10.;
break;
case TT_SWORD:
if (c_features.type != CMT_PLANT)
time = 10.;
break;
case TT_SHEAR:
if (c_features.type != CMT_PLANT)
time *= 10.;
@ -88,8 +91,8 @@ DiggingProperties getDiggingProperties(content_t content, content_t tool)
time = 10.;
break;
case TT_SPEAR:
if (c_features.type == CMT_DIRT)
time *= 2.0;
if (c_features.type != CMT_DIRT)
time = 10.;
break;
case TT_NONE:
if (c_features.type == CMT_DIRT)
@ -291,7 +294,7 @@ void content_toolitem_init()
f->name = "WSword";
f->description = wgettext("Wooden Sword");
f->type = TT_SWORD;
f->hardness = 20.;
f->hardness = 120.;
f->dig_time = 1.5;
crafting::setSwordRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSWORD);
crafting::setSwordRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSWORD);
@ -305,7 +308,7 @@ void content_toolitem_init()
f->name = "STSword";
f->description = wgettext("Stone Sword");
f->type = TT_SWORD;
f->hardness = 50.;
f->hardness = 300.;
f->dig_time = 1.0;
crafting::setSwordRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSWORD);
lists::add("craftguide",i);
@ -318,7 +321,7 @@ void content_toolitem_init()
f->name = "SteelSword";
f->description = wgettext("Steel Sword");
f->type = TT_SWORD;
f->hardness = 80.;
f->hardness = 380.;
f->dig_time = 0.5;
crafting::setSwordRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSWORD);
lists::add("craftguide",i);

View File

@ -863,6 +863,7 @@ void ServerEnvironment::step(float dtime)
bool circuitstep = m_active_blocks_circuit_interval.step(dtime, 0.2);
bool metastep = m_active_blocks_nodemetadata_interval.step(dtime, 1.0);
bool nodestep = m_active_blocks_test_interval.step(dtime, 10.0);
bool has_spawned_mob = false;
if (circuitstep || metastep || nodestep) {
float circuit_dtime = 0.2;
@ -956,12 +957,12 @@ void ServerEnvironment::step(float dtime)
for(s16 y=-1; y<=1; y++)
for(s16 z=-1; z<=1; z++)
{
MapBlock *block = m_map->getBlockNoCreateNoEx(bp+v3s16(x,y,z));
if(block==NULL)
MapBlock *wblock = m_map->getBlockNoCreateNoEx(bp+v3s16(x,y,z));
if (wblock == NULL)
continue;
active_object_count_wider +=
block->m_static_objects.m_active.size()
+ block->m_static_objects.m_stored.size();
wblock->m_static_objects.m_active.size()
+ wblock->m_static_objects.m_stored.size();
}
v3s16 p0;
@ -973,8 +974,10 @@ void ServerEnvironment::step(float dtime)
block->incNodeTicks(p0);
MapNode n = block->getNodeNoEx(p0);
if (content_mob_spawn(this,p,active_object_count_wider))
if (!has_spawned_mob && content_mob_spawn(this,p,active_object_count_wider)) {
has_spawned_mob = true;
active_object_count_wider++;
}
switch(n.getContent()) {
case CONTENT_GRASS_FOOTSTEPS: