浏览代码

Bugfix: right maximum loader : considering the weapon stock

Fabrice Ecaille 12 年之前
父节点
当前提交
75828a2c9a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      js/spaceinvaders-models.js

+ 1 - 1
js/spaceinvaders-models.js

@@ -246,7 +246,7 @@ Weapon.prototype = {
 		
 		if( !this.reload_timer) {
 			this.reload_timer = setInterval( function() {
-				_this.load = Math.min(_this.load + 1, _this.max_load);
+				_this.load = Math.min(_this.load + 1, Math.min(_this.max_load, _this.stock));
 				if( _this.load == _this.max_load ) {
 					clearInterval(_this.reload_timer);
 					_this.reload_timer = false;