// And never save to disk
bool isStaticAllowed() const
{ return false; }
-
+
static ServerActiveObject* create(ServerEnvironment *env, v3f pos,
const std::string &data)
{
}
u8 getType() const
{ return ACTIVEOBJECT_TYPE_TEST; }
-
+
static ServerActiveObject* create(ServerEnvironment *env, v3f pos,
const std::string &data)
{
public:
u8 getType() const
{ return ACTIVEOBJECT_TYPE_ITEM; }
-
+
float getMinimumSavedMovement()
{ return 0.1*BS; }
if(m_move_interval.step(dtime, interval)==false)
return;
dtime = interval;
-
+
core::aabbox3d<f32> box(-BS/3.,0.0,-BS/3., BS/3.,BS*2./3.,BS/3.);
collisionMoveResult moveresult;
// Apply gravity
if(m_speed_f.getLength()*dtime > pos_max_d)
m_speed_f *= pos_max_d / (m_speed_f.getLength()*dtime);
v3f pos_f = getBasePosition();
- v3f pos_f_old = pos_f;
v3f accel_f = v3f(0,0,0);
f32 stepheight = 0;
moveresult = collisionMoveSimple(m_env,m_env->getGameDef(),
pos_max_d, box, stepheight, dtime,
pos_f, m_speed_f, accel_f);
-
+
if(send_recommended == false)
return;
m_itemstring_changed = true;
}
}
-
+
return 0;
}
ServerActiveObject::registerType(getType(), create);
return;
}
-
+
// Initialize something to armor groups
m_armor_groups["fleshy"] = 100;
}
void LuaEntitySAO::addedToEnvironment(u32 dtime_s)
{
ServerActiveObject::addedToEnvironment(dtime_s);
-
+
// Create entity from name
m_registered = m_env->getScriptIface()->
luaentity_Add(m_id, m_init_name.c_str());
-
+
if(m_registered){
// Get properties
m_env->getScriptIface()->
return 0;
}
- // It's best that attachments cannot be punched
+ // It's best that attachments cannot be punched
if(isAttached())
return 0;
-
+
ItemStack *punchitem = NULL;
ItemStack punchitem_static;
if(puncher){
toolcap,
punchitem,
time_from_last_punch);
-
+
if(result.did_punch)
{
setHP(getHP() - result.damage);
-
+
std::string punchername = "nil";
actionstream<<getDescription()<<" punched by "
<<punchername<<", damage "<<result.damage
<<" hp, health now "<<getHP()<<" hp"<<std::endl;
-
+
{
std::string str = gob_cmd_punched(result.damage, getHP());
// create message and add to list
// If the object is attached client-side, don't waste bandwidth sending its position to clients
if(isAttached())
return;
-
+
m_last_sent_move_precision = m_base_position.getDistanceFrom(
m_last_sent_position);
m_last_sent_position_timer = 0;
return false;
}
-bool PlayerSAO::unlimitedTransferDistance() const
-{
- return g_settings->getBool("unlimited_player_transfer_distance");
-}
-
std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
{
std::ostringstream os(std::ios::binary);
ServerActiveObject *puncher,
float time_from_last_punch)
{
- // It's best that attachments cannot be punched
+ // It's best that attachments cannot be punched
if(isAttached())
return 0;
*/
float player_max_speed = 0;
- float player_max_speed_up = 0;
if(m_privs.count("fast") != 0){
// Fast speed
player_max_speed = m_player->movement_speed_fast;
- player_max_speed_up = m_player->movement_speed_fast;
} else {
// Normal speed
player_max_speed = m_player->movement_speed_walk;
- player_max_speed_up = m_player->movement_speed_walk;
}
// Tolerance. With the lag pool we shouldn't need it.
//player_max_speed *= 2.5;