Merge branch 'v1.3-fixes' into 'master'

V1.3 fixes

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!161
This commit is contained in:
Leratier Bretonnien 2021-02-28 07:34:44 +00:00
commit da7d67b3d7
3 changed files with 13 additions and 15 deletions

View File

@ -313,15 +313,13 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async deleteSortReserve(sortReserve) { async deleteSortReserve(sortReserve) {
let reserve = duplicate(this.data.data.reve.reserve); let reserve = duplicate(this.data.data.reve.reserve);
let len = reserve.list.length; let tmr = TMRUtility.getTMR(sortReserve.coord);
let i = 0; let index = reserve.list.findIndex(tmr.type == 'fleuve'
let newTable = []; ? sort => (TMRUtility.getTMR(sort.coord).type == 'fleuve' && sort.sort.name == sortReserve.sort.name)
for (i = 0; i < len; i++) { : sort => (sort.coord == sortReserve.coord && sort.sort.name == sortReserve.sort.name)
if (reserve.list[i].coord != sortReserve.coord && reserve.list[i].sort.name != sortReserve.sort.name) );
newTable.push(reserve.list[i]); if (index >=0 ) {
} reserve.list.splice(index,1);
if (newTable.length != len) {
reserve.list = newTable;
await this.update({ "data.reve.reserve": reserve }); await this.update({ "data.reve.reserve": reserve });
} }
} }

View File

@ -26,7 +26,7 @@ export class Grammar {
/* -------------------------------------------- */ /* -------------------------------------------- */
static articleDetermine(genre) { static articleDetermine(genre) {
switch (toLowerCaseNoAccent(genre)) { switch (Grammar.toLowerCaseNoAccent(genre)) {
case 'f': case 'feminin': return 'la'; case 'f': case 'feminin': return 'la';
case 'p': case 'mp': case 'fp': case 'pluriel': return 'les'; case 'p': case 'mp': case 'fp': case 'pluriel': return 'les';
default: default:
@ -35,8 +35,8 @@ export class Grammar {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static articleIndétermine(genre) { static articleIndetermine(genre) {
switch (toLowerCaseNoAccent(genre)) { switch (Grammar.toLowerCaseNoAccent(genre)) {
case 'f': case 'feminin': return 'une'; case 'f': case 'feminin': return 'une';
case 'p': case 'fp': case 'mp': case 'pluriel': return 'des'; case 'p': case 'fp': case 'mp': case 'pluriel': return 'des';
case 'n': case 'neutre': return 'du' case 'n': case 'neutre': return 'du'
@ -58,7 +58,7 @@ export class Grammar {
* @param {...any} mots * @param {...any} mots
*/ */
static accord(genre, ...mots) { static accord(genre, ...mots) {
switch (toLowerCaseNoAccent(genre)) { switch (Grammar.toLowerCaseNoAccent(genre)) {
default: default:
case 'n': case 'neutre': case 'n': case 'neutre':
case 'm': case 'masculin': return mots[0]; case 'm': case 'masculin': return mots[0];

View File

@ -5,8 +5,8 @@
<option value="maitrisee">Case humide maitrisée (Quête des Eaux)</option> <option value="maitrisee">Case humide maitrisée (Quête des Eaux)</option>
<option value="fermeture">Fermeture cité</option> <option value="fermeture">Fermeture cité</option>
<option value="pont-impraticable">Pont impraticable</option> <option value="pont-impraticable">Pont impraticable</option>
<option value="desorientation">Désoriantation</option> <option value="desorientation">Désorientation</option>
<option value="periple">Periple</option> <option value="periple">Périple</option>
<option value="conquete">Conquête</option> <option value="conquete">Conquête</option>
<option value="pelerinage">Pèlerinage</option> <option value="pelerinage">Pèlerinage</option>
<option value="present-cites">Présents des cités</option> <option value="present-cites">Présents des cités</option>