Added dburles:collection-helpers to fix transformations
This commit is contained in:
1
TODO.md
1
TODO.md
@@ -3,7 +3,6 @@ Character.js is under construction... expect broken character sheets
|
||||
issues
|
||||
------
|
||||
|
||||
* hot code pushes don't apply transforms correctly
|
||||
|
||||
Characters attributes and buffs
|
||||
-------------------------------
|
||||
|
||||
@@ -10,4 +10,5 @@ iron:router
|
||||
accounts-password
|
||||
accounts-ui
|
||||
random
|
||||
dburles:collection-helpers
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ callback-hook@1.0.1
|
||||
check@1.0.2
|
||||
ctl-helper@1.0.4
|
||||
ctl@1.0.2
|
||||
dburles:collection-helpers@1.0.1
|
||||
ddp@1.0.11
|
||||
deps@1.0.5
|
||||
ejson@1.0.4
|
||||
|
||||
@@ -153,7 +153,7 @@ Character = function(owner){
|
||||
}
|
||||
|
||||
//functions and calculated values go here
|
||||
protoCharacter = {
|
||||
Characters.helpers({
|
||||
attributeValue: function(attribute){
|
||||
if (attribute === undefined) return;
|
||||
//base value
|
||||
@@ -282,7 +282,7 @@ protoCharacter = {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
getMod = function(score){
|
||||
return Math.floor((score-10)/2);
|
||||
|
||||
@@ -14,13 +14,6 @@ Router.map( function () {
|
||||
notFoundTemplate: 'characterNotFound',
|
||||
data: function() {
|
||||
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;
|
||||
}
|
||||
});
|
||||
@@ -31,9 +24,6 @@ Router.map( function () {
|
||||
data: {
|
||||
containers: function() {
|
||||
var containers = Containers.find({owner: data._id});
|
||||
containers.forEach(function(container){
|
||||
container.items = Items.find({container: container._id});
|
||||
});
|
||||
return containers;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user