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.
ipv6
Maikel de Vries 2016-12-19 22:49:28 +01:00
parent caef28c7f6
commit ae6cdc6619
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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;
}