Skip to content

Commit 7e34621

Browse files
RealBadAngelsfan5
authored andcommittedOct 22, 2014
Fix broken plantlike drawtype.
1 parent 171bbd7 commit 7e34621

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed
 

‎src/content_mapblock.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -1153,40 +1153,40 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
11531153
{
11541154
TileSpec tile = getNodeTileN(n, p, 0, data);
11551155
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
1156-
1156+
11571157
u16 l = getInteriorLight(n, 1, nodedef);
11581158
video::SColor c = MapBlock_LightColor(255, l, f.light_source);
1159-
1160-
float s = BS/2*f.visual_scale;
1161-
1162-
for(u32 j=0; j<2; j++)
1159+
1160+
float s = BS / 2;
1161+
for(u32 j = 0; j < 2; j++)
11631162
{
11641163
video::S3DVertex vertices[4] =
11651164
{
1166-
video::S3DVertex(-s,-BS/2, 0, 0,0,0, c, 0,1),
1167-
video::S3DVertex( s,-BS/2, 0, 0,0,0, c, 1,1),
1168-
video::S3DVertex( s,-BS/2 + s*2,0, 0,0,0, c, 1,0),
1169-
video::S3DVertex(-s,-BS/2 + s*2,0, 0,0,0, c, 0,0),
1165+
video::S3DVertex(-s,-s, 0, 0,0,0, c, 0,1),
1166+
video::S3DVertex( s,-s, 0, 0,0,0, c, 1,1),
1167+
video::S3DVertex( s, s, 0, 0,0,0, c, 1,0),
1168+
video::S3DVertex(-s, s, 0, 0,0,0, c, 0,0),
11701169
};
11711170

11721171
if(j == 0)
11731172
{
1174-
for(u16 i=0; i<4; i++)
1173+
for(u16 i = 0; i < 4; i++)
11751174
vertices[i].Pos.rotateXZBy(46 + n.param2 * 2);
11761175
}
11771176
else if(j == 1)
11781177
{
1179-
for(u16 i=0; i<4; i++)
1178+
for(u16 i = 0; i < 4; i++)
11801179
vertices[i].Pos.rotateXZBy(-44 + n.param2 * 2);
11811180
}
11821181

1183-
for(u16 i=0; i<4; i++)
1182+
for(u16 i = 0; i < 4; i++)
11841183
{
11851184
vertices[i].Pos *= f.visual_scale;
1185+
vertices[i].Pos.Y -= s * (1 - f.visual_scale);
11861186
vertices[i].Pos += intToFloat(p, BS);
11871187
}
11881188

1189-
u16 indices[] = {0,1,2,2,3,0};
1189+
u16 indices[] = {0, 1, 2, 2, 3, 0};
11901190
// Add to mesh collector
11911191
collector.append(tile, vertices, 4, indices, 6);
11921192
}

0 commit comments

Comments
 (0)
Please sign in to comment.