summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemBow.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-23 08:29:31 +0200
committerMattes D <github@xoft.cz>2014-10-23 08:29:31 +0200
commit4bfd2c9707f2c8484587f061393e8f9346d60fef (patch)
tree4b7bea204c0ddd18bb4f95357f9eb77590bc2e8d /src/Items/ItemBow.h
parentComposableGenerator: Removed nullptr initializers. (diff)
parentEn masse NULL -> nullptr replace (diff)
downloadcuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar
cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.gz
cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.bz2
cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.lz
cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.xz
cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.tar.zst
cuberite-4bfd2c9707f2c8484587f061393e8f9346d60fef.zip
Diffstat (limited to 'src/Items/ItemBow.h')
-rw-r--r--src/Items/ItemBow.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h
index f29cc5d59..cf2fe9ad2 100644
--- a/src/Items/ItemBow.h
+++ b/src/Items/ItemBow.h
@@ -29,7 +29,7 @@ public:
virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir) override
{
- ASSERT(a_Player != NULL);
+ ASSERT(a_Player != nullptr);
// Check if the player has an arrow in the inventory, or is in Creative:
if (!(a_Player->IsGameModeCreative() || a_Player->GetInventory().HasItems(cItem(E_ITEM_ARROW))))
@@ -45,7 +45,7 @@ public:
virtual void OnItemShoot(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
{
// Actual shot - produce the arrow with speed based on the ticks that the bow was charged
- ASSERT(a_Player != NULL);
+ ASSERT(a_Player != nullptr);
int BowCharge = a_Player->FinishChargingBow();
double Force = (double)BowCharge / 20.0;
@@ -65,14 +65,14 @@ public:
// Create the arrow entity:
cArrowEntity * Arrow = new cArrowEntity(*a_Player, Force * 2);
- if (Arrow == NULL)
+ if (Arrow == nullptr)
{
return;
}
if (!Arrow->Initialize(*a_Player->GetWorld()))
{
delete Arrow;
- Arrow = NULL;
+ Arrow = nullptr;
return;
}
a_Player->GetWorld()->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY(), a_Player->GetPosZ(), 0.5, (float)Force);