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() {
|
computeMalusSurEncombrement() {
|
||||||
|
switch (this.type) {
|
||||||
|
case 'entite': case 'vehicule':
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return Math.min(0, this.getEncombrementMax() - Math.ceil(Number(this.getEncTotal())));
|
return Math.min(0, this.getEncombrementMax() - Math.ceil(Number(this.getEncTotal())));
|
||||||
}
|
}
|
||||||
getMessageSurEncombrement(){
|
getMessageSurEncombrement(){
|
||||||
@ -1295,9 +1299,14 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getEncombrementMax() {
|
getEncombrementMax() {
|
||||||
return (this.data.type == 'vehicule')
|
switch (this.type){
|
||||||
? Misc.templateData(this).capacite_encombrement
|
case 'vehicule':
|
||||||
: Misc.templateData(this).attributs.encombrement.value;
|
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