Skip to content
Permalink
Browse files

fix return value of InsertMaterial when a pixel is created

This is a partial fix for #1865. Also this return value still needs to be fixed for query_only == true, but that requires a bit more work in C4PXS.
  • Loading branch information
MDT-Maikel committed Dec 19, 2016
1 parent caef28c commit ae6cdc6619ee69797c6f1627c41e447a8a733fdb
Showing with 4 additions and 2 deletions.
  1. +3 −1 src/landscape/C4Landscape.cpp
  2. +1 −1 src/landscape/C4PXS.cpp
@@ -1021,7 +1021,9 @@ bool C4Landscape::InsertMaterial(int32_t mat, int32_t *tx, int32_t *ty, int32_t
while (FindMatSlide(*tx, *ty, +1, mdens, ::MaterialMap.Map[mat].MaxSlide))
if (GetDensity(*tx, *ty + 1) < mdens)
{
if (!query_only) ::PXS.Create(mat, itofix(*tx), itofix(*ty), C4REAL10(vx), C4REAL10(vy)); return true;
if (!query_only)
return ::PXS.Create(mat, itofix(*tx), itofix(*ty), C4REAL10(vx), C4REAL10(vy));
return true;
}

if (query_only)
@@ -201,7 +201,7 @@ C4PXS* C4PXSSystem::New()
for (cnt2=0,pxp=Chunk[cnt]; cnt2<PXSChunkSize; cnt2++,pxp++)
if (pxp->Mat==MNone)
{
// count theam
// count them
iChunkPXS[cnt]++;
return pxp;
}

0 comments on commit ae6cdc6

Please sign in to comment.