Fix #6 Crew limits
This commit is contained in:
@ -1122,7 +1122,7 @@ export class PegasusActor extends Actor {
|
||||
modifyHeroLevelRemaining(incDec) {
|
||||
let biodata = duplicate(this.system.biodata)
|
||||
biodata.currentlevelremaining = Math.max(biodata.currentlevelremaining + incDec, 0)
|
||||
this.update({ "data.biodata": biodata })
|
||||
this.update({ "system.biodata": biodata })
|
||||
ChatMessage.create({ content: `${this.name} has used a Hero Level to reroll !` })
|
||||
return biodata.currentlevelremaining
|
||||
}
|
||||
@ -2063,6 +2063,10 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addCrew(actorId) {
|
||||
if ( this.system.crew.length >= this.system.crewmax) {
|
||||
ui.notifications.warn("Vehicle crew is already full.")
|
||||
return
|
||||
}
|
||||
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
|
||||
crewList.push({ id: actorId })
|
||||
this.update({ 'system.crew': crewList })
|
||||
|
Reference in New Issue
Block a user