Made TNT pickups spawning chance 25%

master
Tiger Wang 2013-11-27 22:03:04 +00:00
parent a6630d3239
commit 994e1d7335
2 changed files with 3 additions and 3 deletions

View File

@ -1655,12 +1655,12 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_
default: default:
{ {
if (m_World->GetTickRandomNumber(10) == 5) if (m_World->GetTickRandomNumber(4) == 4) // Around 25% chance of pickups
{ {
cItems Drops; cItems Drops;
cBlockHandler * Handler = BlockHandler(Block); cBlockHandler * Handler = BlockHandler(Block);
Handler->ConvertToPickups(Drops, area.GetBlockMeta(bx + x, by + y, bz + z)); Handler->ConvertToPickups(Drops, area.GetBlockMeta(bx + x, by + y, bz + z)); // Stone becomes cobblestone, coal ore becomes coal, etc.
m_World->SpawnItemPickups(Drops, bx + x, by + y, bz + z); m_World->SpawnItemPickups(Drops, bx + x, by + y, bz + z);
} }
area.SetBlockType(bx + x, by + y, bz + z, E_BLOCK_AIR); area.SetBlockType(bx + x, by + y, bz + z, E_BLOCK_AIR);

View File

@ -1046,7 +1046,7 @@ void cWorld::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_Blo
return; return;
} }
// TODO: Add damage to entities, add support for pickups, and implement block hardiness // TODO: Add damage to entities and implement block hardiness
Vector3d explosion_pos = Vector3d(a_BlockX, a_BlockY, a_BlockZ); Vector3d explosion_pos = Vector3d(a_BlockX, a_BlockY, a_BlockZ);
cVector3iArray BlocksAffected; cVector3iArray BlocksAffected;
m_ChunkMap->DoExplosionAt(a_ExplosionSize, a_BlockX, a_BlockY, a_BlockZ, BlocksAffected); m_ChunkMap->DoExplosionAt(a_ExplosionSize, a_BlockX, a_BlockY, a_BlockZ, BlocksAffected);