Fixed a few problems in the ladder update, and changed the speed to account for gravity
authorMark Holmquist <marktraceur@gmail.com>
Sun, 31 Jul 2011 00:26:13 +0000 (17:26 -0700)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 1 Aug 2011 07:22:36 +0000 (09:22 +0200)
src/content_mapblock.cpp
src/game.cpp
src/player.cpp

index ceb673606384049338d0e80b7cedb368a96548e0..ed2cd766a032acdca7c640b7b459a162168498b3 100644 (file)
@@ -1134,7 +1134,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                        u16 indices[] = {0,1,2,2,3,0};
                        collector.append(material_rail, vertices, 4, indices, 6);
                }
-               else if (n.d == CONTENT_LADDER) {
+               else if (n.getContent() == CONTENT_LADDER) {
                        u8 l = decode_light(n.getLightBlend(data->m_daynight_ratio));
                        video::SColor c(255,l,l,l);
 
@@ -1149,7 +1149,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
                                video::S3DVertex(BS/2-d,BS/2,-BS/2, 0,0,0, c, 0,0),
                        };
 
-                       v3s16 dir = unpackDir(n.dir);
+                       v3s16 dir = unpackDir(n.param2);
 
                        for(s32 i=0; i<4; i++)
                        {
index d8ea45fb1f74248b06ec4f49f906bae6c9455133..fb5d7cb93f7f9bd67794d84e01871bc04da68467 100644 (file)
@@ -541,7 +541,7 @@ void getPointedNode(Client *client, v3f player_position,
 
                else if(n.getContent() == CONTENT_LADDER)
                {
-                       v3s16 dir = unpackDir(n.dir);
+                       v3s16 dir = unpackDir(n.param2);
                        v3f dir_f = v3f(dir.X, dir.Y, dir.Z);
                        dir_f *= BS/2 - BS/6 - BS/20;
                        v3f cpf = npf + dir_f;
index 3846cd8f9e676c2324b9d24ddb2f9a6f78f8a648..270f795b51229b2ad57462515a96bc8a626f51fc 100644 (file)
@@ -382,8 +382,8 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
        try {
                v3s16 pp = floatToInt(position + v3f(0,0.5*BS,0), BS);
                v3s16 pp2 = floatToInt(position + v3f(0,-0.2*BS,0), BS);
-               is_climbing = (content_features(map.getNode(pp).d).climbable ||
-                              content_features(map.getNode(pp2).d).climbable);
+               is_climbing = (content_features(map.getNode(pp).getContent()).climbable ||
+                              content_features(map.getNode(pp2).getContent()).climbable);
        }
        catch(InvalidPositionException &e)
        {
@@ -832,7 +832,7 @@ void LocalPlayer::applyControl(float dtime)
        if (is_climbing) {
                if (control.up || control.left || control.right || control.down) {
                        v3f speed = getSpeed();
-                       speed.Y = 2*BS;
+                       speed.Y = 2.5*BS;
                        setSpeed(speed);
                }
                else {