Просмотр исходного кода

Fixed a big causing digestion to not happen repeatedly

tags/v0.7.0
Fen Dweller 8 лет назад
Родитель
Сommit
450dff87b4
1 измененных файлов: 9 добавлений и 5 удалений
  1. +9
    -5
      game.js

+ 9
- 5
game.js Просмотреть файл

@@ -99,7 +99,7 @@ var macro =
return volume * this.breastDensity; return volume * this.breastDensity;
}, },


"digest": function(organ) {
"digest": function(owner,organ) {
var count = Math.min(organ.contents.length, organ.maxDigest); var count = Math.min(organ.contents.length, organ.maxDigest);


var container = new Container(); var container = new Container();
@@ -125,6 +125,10 @@ var macro =
organ.fill(this,container); organ.fill(this,container);
var summary = summarize(container.sum()); var summary = summarize(container.sum());


if (organ.contents.length > 0) {
setTimeout(function() { owner.digest(owner,organ) }, 15000);
}

update([line,summary,newline]); update([line,summary,newline]);
}, },


@@ -135,7 +139,7 @@ var macro =
}, },
"feedFunc": function(prey,self,owner) { "feedFunc": function(prey,self,owner) {
if (self.contents.length == 0) if (self.contents.length == 0)
setTimeout(function() { owner.digest(self) }, 15000);
setTimeout(function() { owner.digest(owner,self) }, 15000);
this.contents.push(prey); this.contents.push(prey);
}, },
"describeDigestion": function(container) { "describeDigestion": function(container) {
@@ -155,7 +159,7 @@ var macro =
}, },
"feedFunc": function(prey,self,owner) { "feedFunc": function(prey,self,owner) {
if (self.contents.length == 0) if (self.contents.length == 0)
setTimeout(function() { owner.digest(self) }, 15000);
setTimeout(function() { owner.digest(owner,self) }, 15000);
this.contents.push(prey); this.contents.push(prey);
}, },
"describeDigestion" : function(container) { "describeDigestion" : function(container) {
@@ -175,7 +179,7 @@ var macro =
}, },
"feedFunc": function(prey,self,owner) { "feedFunc": function(prey,self,owner) {
if (self.contents.length == 0) if (self.contents.length == 0)
setTimeout(function() { owner.digest(self) }, 15000);
setTimeout(function() { owner.digest(owner,self) }, 15000);
this.contents.push(prey); this.contents.push(prey);
}, },
"describeDigestion" : function(container) { "describeDigestion" : function(container) {
@@ -195,7 +199,7 @@ var macro =
}, },
"feedFunc": function(prey,self,owner) { "feedFunc": function(prey,self,owner) {
if (self.contents.length == 0) if (self.contents.length == 0)
setTimeout(function() { owner.digest(self) }, 15000);
setTimeout(function() { owner.digest(owner,self) }, 15000);
this.contents.push(prey); this.contents.push(prey);
}, },
"describeDigestion": function(container) { "describeDigestion": function(container) {


Загрузка…
Отмена
Сохранить