1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

cavegen.cpp, chat.cpp: modernize code

This commit is contained in:
Loic Blot 2017-08-16 08:26:04 +02:00
parent 9dd0f952e0
commit 90dfafcda2
No known key found for this signature in database
GPG key ID: EFAA458E8C153987
3 changed files with 20 additions and 34 deletions

View file

@ -515,7 +515,7 @@ void CavesRandomWalk::carveRoute(v3f vec, float f, bool randomize_xz)
v3s16 p(cp.X + x0, cp.Y + y0, cp.Z + z0);
p += of;
if (vm->m_area.contains(p) == false)
if (!vm->m_area.contains(p))
continue;
u32 i = vm->m_area.index(p);
@ -819,7 +819,7 @@ void CavesV6::carveRoute(v3f vec, float f, bool randomize_xz,
v3s16 p(cp.X + x0, cp.Y + y0, cp.Z + z0);
p += of;
if (vm->m_area.contains(p) == false)
if (!vm->m_area.contains(p))
continue;
u32 i = vm->m_area.index(p);
@ -858,7 +858,8 @@ inline s16 CavesV6::getSurfaceFromHeightmap(v3s16 p)
p.X >= node_min.X && p.X <= node_max.X) {
u32 index = (p.Z - node_min.Z) * ystride + (p.X - node_min.X);
return heightmap[index];
} else {
return water_level;
}
return water_level;
}