Spells that aren't prepared no longer count as active properties
This commit is contained in:
@@ -6,12 +6,14 @@ export default function getActiveProperties({
|
|||||||
filter = {},
|
filter = {},
|
||||||
options = {sort: {order: 1}},
|
options = {sort: {order: 1}},
|
||||||
includeUntoggled = false,
|
includeUntoggled = false,
|
||||||
|
includeUnprepared = false,
|
||||||
excludeAncestors,
|
excludeAncestors,
|
||||||
}){
|
}){
|
||||||
filter = getActivePropertyFilter({
|
filter = getActivePropertyFilter({
|
||||||
ancestorId,
|
ancestorId,
|
||||||
filter,
|
filter,
|
||||||
includeUntoggled,
|
includeUntoggled,
|
||||||
|
includeUnprepared,
|
||||||
excludeAncestors,
|
excludeAncestors,
|
||||||
});
|
});
|
||||||
return CreatureProperties.find(filter, options).fetch();
|
return CreatureProperties.find(filter, options).fetch();
|
||||||
@@ -21,6 +23,7 @@ export function getActivePropertyFilter({
|
|||||||
ancestorId,
|
ancestorId,
|
||||||
filter = {},
|
filter = {},
|
||||||
includeUntoggled = false,
|
includeUntoggled = false,
|
||||||
|
includeUnprepared = false,
|
||||||
excludeAncestors = [],
|
excludeAncestors = [],
|
||||||
}){
|
}){
|
||||||
if (!ancestorId){
|
if (!ancestorId){
|
||||||
@@ -38,6 +41,12 @@ export function getActivePropertyFilter({
|
|||||||
if (!includeUntoggled){
|
if (!includeUntoggled){
|
||||||
disabledAncestorsFilter.$or.push({toggleResult: false});
|
disabledAncestorsFilter.$or.push({toggleResult: false});
|
||||||
}
|
}
|
||||||
|
if (!includeUnprepared){
|
||||||
|
disabledAncestorsFilter.$or.push({
|
||||||
|
prepared: false,
|
||||||
|
alwaysPrepared: false
|
||||||
|
});
|
||||||
|
}
|
||||||
let disabledAncestorIds = CreatureProperties.find(disabledAncestorsFilter, {
|
let disabledAncestorIds = CreatureProperties.find(disabledAncestorsFilter, {
|
||||||
fields: {_id: 1},
|
fields: {_id: 1},
|
||||||
}).map(prop => prop._id);
|
}).map(prop => prop._id);
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ export default {
|
|||||||
order: 1,
|
order: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
includeUnprepared: this.preparingSpells,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
numPrepared(){
|
numPrepared(){
|
||||||
|
|||||||
Reference in New Issue
Block a user