diff options
author | worktycho <work.tycho@gmail.com> | 2014-07-13 15:09:08 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-07-13 16:16:49 +0200 |
commit | 4a6d606f7499582e6ec2953e663e98153a19a613 (patch) | |
tree | 31edb60180c1d863cb0c10cf4fac6b99025e0414 /src/Entities | |
parent | Fixed MSVC warnings in SoundEffect functions. (diff) | |
download | cuberite-4a6d606f7499582e6ec2953e663e98153a19a613.tar cuberite-4a6d606f7499582e6ec2953e663e98153a19a613.tar.gz cuberite-4a6d606f7499582e6ec2953e663e98153a19a613.tar.bz2 cuberite-4a6d606f7499582e6ec2953e663e98153a19a613.tar.lz cuberite-4a6d606f7499582e6ec2953e663e98153a19a613.tar.xz cuberite-4a6d606f7499582e6ec2953e663e98153a19a613.tar.zst cuberite-4a6d606f7499582e6ec2953e663e98153a19a613.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/ProjectileEntity.cpp | 7 | ||||
-rw-r--r-- | src/Entities/ProjectileEntity.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index 0bb34019e..b5ef5c90a 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -243,7 +243,7 @@ cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, const Ve -cProjectileEntity * cProjectileEntity::Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem & a_Item, const Vector3d * a_Speed) +cProjectileEntity * cProjectileEntity::Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem * a_Item, const Vector3d * a_Speed) { Vector3d Speed; if (a_Speed != NULL) @@ -262,12 +262,13 @@ cProjectileEntity * cProjectileEntity::Create(eKind a_Kind, cEntity * a_Creator, case pkExpBottle: return new cExpBottleEntity (a_Creator, a_X, a_Y, a_Z, Speed); case pkFirework: { - if (a_Item.m_FireworkItem.m_Colours.empty()) + ASSERT(a_Item != NULL); + if (a_Item->m_FireworkItem.m_Colours.empty()) { return NULL; } - return new cFireworkEntity(a_Creator, a_X, a_Y, a_Z, a_Item); + return new cFireworkEntity(a_Creator, a_X, a_Y, a_Z, *a_Item); } } diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h index 7b38169e2..14cee1272 100644 --- a/src/Entities/ProjectileEntity.h +++ b/src/Entities/ProjectileEntity.h @@ -46,7 +46,7 @@ public: cProjectileEntity(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, double a_Width, double a_Height); cProjectileEntity(eKind a_Kind, cEntity * a_Creator, const Vector3d & a_Pos, const Vector3d & a_Speed, double a_Width, double a_Height); - static cProjectileEntity * Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem & a_Item, const Vector3d * a_Speed = NULL); + static cProjectileEntity * Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem * a_Item, const Vector3d * a_Speed = NULL); /// Called by the physics blocktracer when the entity hits a solid block, the hit position and the face hit (BLOCK_FACE_) is given virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace); |