Changing pickup lifetime and combining semantics, making these adjustable in the lua api. (#3843)
This commit is contained in:
@@ -2223,6 +2223,22 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double
|
||||
|
||||
|
||||
|
||||
UInt32 cWorld::SpawnItemPickup(double a_PosX, double a_PosY, double a_PosZ, const cItem & a_Item, float a_SpeedX, float a_SpeedY, float a_SpeedZ, int a_LifetimeTicks, bool a_CanCombine)
|
||||
{
|
||||
cPickup * Pickup = new cPickup(a_PosX, a_PosY, a_PosZ, a_Item, false, a_SpeedX, a_SpeedY, a_SpeedZ, a_LifetimeTicks, a_CanCombine);
|
||||
if (!Pickup->Initialize(*this))
|
||||
{
|
||||
delete Pickup;
|
||||
Pickup = nullptr;
|
||||
return cEntity::INVALID_ID;
|
||||
}
|
||||
return Pickup->GetUniqueID();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
UInt32 cWorld::SpawnFallingBlock(int a_X, int a_Y, int a_Z, BLOCKTYPE BlockType, NIBBLETYPE BlockMeta)
|
||||
{
|
||||
cFallingBlock * FallingBlock = new cFallingBlock(Vector3i(a_X, a_Y, a_Z), BlockType, BlockMeta);
|
||||
|
||||
Reference in New Issue
Block a user