Fix erreur sur entité de cauchemar
Lié à l'encombrement max, une entité n'en a pas
This commit is contained in:
parent
5bb4e02915
commit
31eab4a04f
@ -1288,6 +1288,10 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
computeMalusSurEncombrement() {
|
||||
switch (this.type) {
|
||||
case 'entite': case 'vehicule':
|
||||
return 0;
|
||||
}
|
||||
return Math.min(0, this.getEncombrementMax() - Math.ceil(Number(this.getEncTotal())));
|
||||
}
|
||||
getMessageSurEncombrement(){
|
||||
@ -1295,9 +1299,14 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
getEncombrementMax() {
|
||||
return (this.data.type == 'vehicule')
|
||||
? Misc.templateData(this).capacite_encombrement
|
||||
: Misc.templateData(this).attributs.encombrement.value;
|
||||
switch (this.type){
|
||||
case 'vehicule':
|
||||
return Misc.templateData(this).capacite_encombrement;
|
||||
case 'entite':
|
||||
return 0;
|
||||
default:
|
||||
return Misc.templateData(this).attributs.encombrement.value;
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user