Added dburles:collection-helpers to fix transformations

This commit is contained in:
Thaum
2014-11-04 07:12:59 +00:00
parent 5fdbb8398f
commit 20340fac77
5 changed files with 4 additions and 13 deletions

View File

@@ -3,7 +3,6 @@ Character.js is under construction... expect broken character sheets
issues issues
------ ------
* hot code pushes don't apply transforms correctly
Characters attributes and buffs Characters attributes and buffs
------------------------------- -------------------------------

View File

@@ -10,4 +10,5 @@ iron:router
accounts-password accounts-password
accounts-ui accounts-ui
random random
dburles:collection-helpers

View File

@@ -14,6 +14,7 @@ callback-hook@1.0.1
check@1.0.2 check@1.0.2
ctl-helper@1.0.4 ctl-helper@1.0.4
ctl@1.0.2 ctl@1.0.2
dburles:collection-helpers@1.0.1
ddp@1.0.11 ddp@1.0.11
deps@1.0.5 deps@1.0.5
ejson@1.0.4 ejson@1.0.4

View File

@@ -153,7 +153,7 @@ Character = function(owner){
} }
//functions and calculated values go here //functions and calculated values go here
protoCharacter = { Characters.helpers({
attributeValue: function(attribute){ attributeValue: function(attribute){
if (attribute === undefined) return; if (attribute === undefined) return;
//base value //base value
@@ -282,7 +282,7 @@ protoCharacter = {
} }
} }
} }
} });
getMod = function(score){ getMod = function(score){
return Math.floor((score-10)/2); return Math.floor((score-10)/2);

View File

@@ -14,13 +14,6 @@ Router.map( function () {
notFoundTemplate: 'characterNotFound', notFoundTemplate: 'characterNotFound',
data: function() { data: function() {
var data = Characters.findOne({_id: this.params._id}); var data = Characters.findOne({_id: this.params._id});
data.features = Features.find({character: data._id});
data.containers = Containers.find({owner: data._id});
data.containers.forEach(function(container){
container.items = Items.find({container: container._id});
});
var newInstance = Object.create(protoCharacter);
data = _.extend(newInstance, data);
return data; return data;
} }
}); });
@@ -31,9 +24,6 @@ Router.map( function () {
data: { data: {
containers: function() { containers: function() {
var containers = Containers.find({owner: data._id}); var containers = Containers.find({owner: data._id});
containers.forEach(function(container){
container.items = Items.find({container: container._id});
});
return containers; return containers;
}, },