Breaks compatibility with old clients.
if (m_is_visible) {
int old_anim = player->last_animation;
float old_anim_speed = player->last_animation_speed;
- m_position = player->getPosition() + v3f(0,BS,0);
+ m_position = player->getPosition();
m_velocity = v3f(0,0,0);
m_acceleration = v3f(0,0,0);
pos_translator.vect_show = m_position;
if (m_is_local_player) {
LocalPlayer *player = m_env->getLocalPlayer();
player->makes_footstep_sound = m_prop.makes_footstep_sound;
+ player->setCollisionbox(m_selection_box);
}
if ((m_is_player && !m_is_local_player) && m_prop.nametag == "")
m_prop.hp_max = PLAYER_MAX_HP;
m_prop.physical = false;
m_prop.weight = 75;
- m_prop.collisionbox = aabb3f(-0.3f, -1.0f, -0.3f, 0.3f, 0.75f, 0.3f);
+ m_prop.collisionbox = aabb3f(-0.3f, 0.0f, -0.3f, 0.3f, 1.77f, 0.3f);
// start of default appearance, this should be overwritten by LUA
m_prop.visual = "upright_sprite";
m_prop.visual_size = v2f(1, 2);
os << serializeString(m_player->getName()); // name
writeU8(os, 1); // is_player
writeS16(os, getId()); //id
- writeV3F1000(os, m_base_position + v3f(0,BS*1,0));
+ writeV3F1000(os, m_base_position);
writeF1000(os, m_yaw);
writeS16(os, getHP());
if(isAttached()) // Just in case we ever do send attachment position too
pos = m_env->getActiveObject(m_attachment_parent_id)->getBasePosition();
else
- pos = m_base_position + v3f(0,BS*1,0);
+ pos = m_base_position;
std::string str = gob_cmd_update_position(
pos,
v3f(0,0,0),
bool PlayerSAO::getCollisionBox(aabb3f *toset) const
{
- *toset = aabb3f(-0.3f * BS, 0.0f, -0.3f * BS, 0.3f * BS, 1.75f * BS, 0.3f * BS);
+ //update collision box
+ toset->MinEdge = m_prop.collisionbox.MinEdge * BS;
+ toset->MaxEdge = m_prop.collisionbox.MaxEdge * BS;
toset->MinEdge += m_base_position;
toset->MaxEdge += m_base_position;
// Drop the item
ItemStack item1 = list_from->getItem(from_i);
item1.count = take_count;
- if (PLAYER_TO_SA(player)->item_OnDrop(item1, player,
- player->getBasePosition() + v3f(0,1,0))) {
+ if(PLAYER_TO_SA(player)->item_OnDrop(item1, player,
+ player->getBasePosition())) {
actually_dropped_count = take_count - item1.count;
if (actually_dropped_count == 0) {
u16 count = it->count;
do {
PLAYER_TO_SA(player)->item_OnDrop(*it, player,
- player->getBasePosition() + v3f(0,1,0));
+ player->getBasePosition());
if (count >= it->count) {
errorstream << "Couldn't drop replacement stack " <<
it->getItemString() << " because drop loop didn't "
v3f getEyePosition() const { return m_position + getEyeOffset(); }
v3f getEyeOffset() const;
+ void setCollisionbox(const aabb3f &box) { m_collisionbox = box; }
+
private:
void accelerateHorizontal(const v3f &target_speed, const f32 max_increase);
void accelerateVertical(const v3f &target_speed, const f32 max_increase);