Skip to content

Commit 1193bc7

Browse files
committed
Return null instead of false.
1 parent ec29511 commit 1193bc7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/plugins/weapon/WeaponPlugin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,13 +707,13 @@ Phaser.Weapon.prototype.trackPointer = function (pointer, offsetX, offsetY) {
707707
* @param {Phaser.Sprite|Phaser.Point|Object} [from] - Optionally fires the bullet **from** the `x` and `y` properties of this object. If set this overrides `Weapon.trackedSprite` or `trackedPointer`. Pass `null` to ignore it.
708708
* @param {number} [x] - The x coordinate, in world space, to fire the bullet **towards**. If left as `undefined` the bullet direction is based on its angle.
709709
* @param {number} [y] - The y coordinate, in world space, to fire the bullet **towards**. If left as `undefined` the bullet direction is based on its angle.
710-
* @return {Phaser.Bullet} The fired bullet if successful, null otherwise.
710+
* @return {Phaser.Bullet} The fired bullet, if a launch was successful, otherwise `null`.
711711
*/
712712
Phaser.Weapon.prototype.fire = function (from, x, y) {
713713

714714
if (this.game.time.now < this._nextFire || (this.fireLimit > 0 && this.shots === this.fireLimit))
715715
{
716-
return false;
716+
return null;
717717
}
718718

719719
var speed = this.bulletSpeed;
@@ -922,7 +922,9 @@ Phaser.Weapon.prototype.fire = function (from, x, y) {
922922
this.onFireLimit.dispatch(this, this.fireLimit);
923923
}
924924
}
925+
925926
return bullet;
927+
926928
};
927929

928930
/**

0 commit comments

Comments
 (0)