04-07-2015, 07:54 AM
Rather than pushing the entire table to Lua and back, it'd be better to wrap the array into an object, cBlockArray:
function OnExploding(World, ExplosionSize, CanCauseFire, X, Y, Z, Source, SourceData, AffectedBlocks) assert(tolua.type(AffectedBlocks) == "cBlockArray") -- It is an object with its own operations -- Example: do NOT explode dirt: for n = AffectedBlocks.GetCount() - 1, 0, -1 do -- count from GetCount() - 1 down to 0 if (AffectedBlock:GetBlockType(n) == E_BLOCK_DIRT) then -- Get the n-th block's type AffectedBlocks.Remove(n) end end return false end