Skip to content

Commit

Permalink
Fix raillike bug (currently manifests itself on Android), and minor i…
Browse files Browse the repository at this point in the history
…mprovement to readability.

NB: Minor edits to patch made by Zeno- (int to short and minor formatting)
  • Loading branch information
KodexKy authored and Zeno- committed Nov 20, 2014
1 parent b1965ac commit b9bc8da
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/content_mapblock.cpp
Expand Up @@ -1621,17 +1621,18 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
video::SColor c = MapBlock_LightColor(255, l, f.light_source);

float d = (float)BS/64;

char g=-1;
float s = BS/2;

short g = -1;
if (is_rail_x_plus_y[0] || is_rail_x_plus_y[1] || is_rail_z_plus_y[0] || is_rail_z_plus_y[1])
g=1; //Object is at a slope
g = 1; //Object is at a slope

video::S3DVertex vertices[4] =
{
video::S3DVertex(-BS/2,-BS/2+d,-BS/2, 0,0,0, c, 0,1),
video::S3DVertex(BS/2,-BS/2+d,-BS/2, 0,0,0, c, 1,1),
video::S3DVertex(BS/2,g*BS/2+d,BS/2, 0,0,0, c, 1,0),
video::S3DVertex(-BS/2,g*BS/2+d,BS/2, 0,0,0, c, 0,0),
video::S3DVertex(-s, -s+d,-s, 0,0,0, c,0,1),
video::S3DVertex( s, -s+d,-s, 0,0,0, c,1,1),
video::S3DVertex( s, g*s+d, s, 0,0,0, c,1,0),
video::S3DVertex(-s, g*s+d, s, 0,0,0, c,0,0),
};

for(s32 i=0; i<4; i++)
Expand Down

0 comments on commit b9bc8da

Please sign in to comment.