diff options
author | Mattes D <github@xoft.cz> | 2014-10-23 08:29:31 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-23 08:29:31 +0200 |
commit | 4bfd2c9707f2c8484587f061393e8f9346d60fef (patch) | |
tree | 4b7bea204c0ddd18bb4f95357f9eb77590bc2e8d /src/Items/ItemBow.h | |
parent | ComposableGenerator: Removed nullptr initializers. (diff) | |
parent | En masse NULL -> nullptr replace (diff) | |
download | cuberite-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.h | 8 |
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); |