Cap material store once objects can't be collect any more

This means that if the Clonk digs Earth but has a full inventory at the time
(so we can't generate Earth chunks), digging another material later can never
yield more than one Earth chunk.
Peter Wortmann 2012-01-21 17:33:00 +00:00
parent 0fe9cb41cd
commit d795f983bb
1 changed files with 2 additions and 0 deletions

View File

@ -505,6 +505,8 @@ void C4Landscape::DigMaterial2Objects(int32_t tx, int32_t ty, C4MaterialList *ma
if(::MaterialMap.Map[mat].Dig2ObjectCollect == 2)
{
pObj->AssignRemoval();
// Cap so we never have more than one object ´worth of material in the store
mat_list->Amount[mat] = ::MaterialMap.Map[mat].Dig2ObjectRatio;
break;
}
mat_list->Amount[mat] -= ::MaterialMap.Map[mat].Dig2ObjectRatio;