Added labels to temporary hitpoints

This commit is contained in:
Thaum
2015-03-30 09:45:48 +00:00
parent ba247ff90d
commit 91fd56f828
4 changed files with 10 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ TemporaryHitPoints = new Mongo.Collection("temporaryHitPoints");
Schemas.TemporaryHitPoints = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
name: {type: String, optional: true},
maximum: {type: Number, defaultValue: 0},
used: {type: Number, defaultValue: 0},
deleteOnZero:{type: Boolean, defaultValue: true},
@@ -9,9 +10,9 @@ Schemas.TemporaryHitPoints = new SimpleSchema({
type: Date,
autoValue: function() {
if (this.isInsert) {
return new Date;
return new Date();
} else if (this.isUpsert) {
return {$setOnInsert: new Date};
return {$setOnInsert: new Date()};
} else {
this.unset();
}