Browse Source

fixes #446

tags/v0.1.10
Big Bad Waffle 6 years ago
parent
commit
63fa5f6bcb
2 changed files with 17 additions and 5 deletions
  1. +13
    -5
      src/client/js/components/gatherer.js
  2. +4
    -0
      src/server/components/gatherer.js

+ 13
- 5
src/client/js/components/gatherer.js View File

@@ -2,7 +2,7 @@ define([
'js/system/client',
'js/system/events',
'js/misc/physics'
], function(
], function (
client,
events,
physics
@@ -11,11 +11,12 @@ define([
type: 'gatherer',
effect: null,

init: function() {
init: function () {
this.obj.on('onKeyDown', this.onKeyDown.bind(this));
events.on('onRezone', this.onRezone.bind(this));
},

extend: function(msg) {
extend: function (msg) {
if ((msg.width) && (msg.progress != 100)) {
if (this.effect)
this.effect.destroyed = true;
@@ -54,7 +55,14 @@ define([
}
},

onKeyDown: function(key) {
onRezone: function () {
this.extend({
progress: 100,
action: 'Fishing'
});
},

onKeyDown: function (key) {
if (key != 'g')
return;

@@ -68,4 +76,4 @@ define([
});
}
};
});
});

+ 4
- 0
src/server/components/gatherer.js View File

@@ -262,6 +262,10 @@ define([
},

events: {
beforeRezone: function () {
this.events.beforeMove.call(this);
},

beforeMove: function () {
if (!this.gathering)
return;


Loading…
Cancel
Save