diff options
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r-- | src/content_cao.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index ee1009b6c..9738dc34c 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -708,11 +708,15 @@ public: if(player && player->isLocal()){ m_is_local_player = true; } + m_env->addPlayerName(m_name.c_str()); } } ~GenericCAO() { + if(m_is_player){ + m_env->removePlayerName(m_name.c_str()); + } } static ClientActiveObject* create(IGameDef *gamedef, ClientEnvironment *env) @@ -860,7 +864,7 @@ public: m_spritenode = smgr->addBillboardSceneNode( NULL, v2f(1, 1), v3f(0,0,0), -1); m_spritenode->setMaterialTexture(0, - tsrc->getTextureRaw("unknown_block.png")); + tsrc->getTextureRaw("unknown_node.png")); m_spritenode->setMaterialFlag(video::EMF_LIGHTING, false); m_spritenode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); m_spritenode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF); @@ -1129,6 +1133,7 @@ public: { LocalPlayer *player = m_env->getLocalPlayer(); player->overridePosition = getParent()->getPosition(); + m_env->getLocalPlayer()->parent = getParent(); } } else @@ -1263,7 +1268,7 @@ public: { if(m_prop.visual == "sprite") { - std::string texturestring = "unknown_block.png"; + std::string texturestring = "unknown_node.png"; if(m_prop.textures.size() >= 1) texturestring = m_prop.textures[0]; texturestring += mod; @@ -1329,7 +1334,7 @@ public: { for (u32 i = 0; i < 6; ++i) { - std::string texturestring = "unknown_block.png"; + std::string texturestring = "unknown_node.png"; if(m_prop.textures.size() > i) texturestring = m_prop.textures[i]; texturestring += mod; @@ -1678,6 +1683,19 @@ public: updateTexturePos(); } + else if(cmd == GENERIC_CMD_SET_PHYSICS_OVERRIDE) + { + float override_speed = readF1000(is); + float override_jump = readF1000(is); + float override_gravity = readF1000(is); + if(m_is_local_player) + { + LocalPlayer *player = m_env->getLocalPlayer(); + player->physics_override_speed = override_speed; + player->physics_override_jump = override_jump; + player->physics_override_gravity = override_gravity; + } + } else if(cmd == GENERIC_CMD_SET_ANIMATION) { m_animation_range = readV2F1000(is); |