@@ -214,7 +214,7 @@ export class MoonSquadGame extends GameBase {
214214 if ( match === null ) {
215215 throw new Error ( `Unable to parse a squad movement click.` ) ;
216216 }
217- const mvs = match [ 1 ] . split ( "; " ) ;
217+ const mvs = match [ 1 ] . split ( ", " ) ;
218218 if ( mvs [ 0 ] === "" ) {
219219 mvs . shift ( ) ;
220220 }
@@ -226,7 +226,7 @@ export class MoonSquadGame extends GameBase {
226226 else {
227227 mvs . push ( cell ) ;
228228 }
229- newmove = move . substring ( 0 , 2 ) + "(" + mvs . join ( "; " ) + ")" ;
229+ newmove = move . substring ( 0 , 2 ) + "(" + mvs . join ( ", " ) + ")" ;
230230 }
231231 // otherwise it must be a capture
232232 else {
@@ -381,7 +381,7 @@ export class MoonSquadGame extends GameBase {
381381 result . message = i18next . t ( "apgames:validation.moonsquad.PARTIAL_MOVE" , { context : "first" } ) ;
382382 return result ;
383383 }
384- const mvs = mvStr . split ( "; " ) ;
384+ const mvs = mvStr . split ( ", " ) ;
385385 const mySquads = this . mySquads ( ) ;
386386 for ( const mv of mvs ) {
387387 const [ from , to ] = mv . split ( "-" ) ;
@@ -555,11 +555,14 @@ export class MoonSquadGame extends GameBase {
555555 if ( oreNum === undefined ) {
556556 throw new Error ( `Could not find a code for the ore colour ${ oreName } .` ) ;
557557 }
558- const oreIdx = this . ore [ this . currplayer - 1 ] . findIndex ( x => x === oreNum ) ;
559- if ( oreIdx > - 1 ) {
560- this . ore [ this . currplayer - 1 ] . splice ( oreIdx , 1 ) ;
558+ // don't sacrifice the ore until the move is complete
559+ if ( ! partial ) {
560+ const oreIdx = this . ore [ this . currplayer - 1 ] . findIndex ( x => x === oreNum ) ;
561+ if ( oreIdx > - 1 ) {
562+ this . ore [ this . currplayer - 1 ] . splice ( oreIdx , 1 ) ;
563+ }
564+ this . results . push ( { type : "sacrifice" , what : oreName } ) ;
561565 }
562- this . results . push ( { type : "sacrifice" , what : oreName } ) ;
563566 let mvStr = "" ;
564567 if ( idx > - 1 ) {
565568 mvStr = m . substring ( idx + 1 ) ;
@@ -571,9 +574,11 @@ export class MoonSquadGame extends GameBase {
571574 this . highlights . push ( ...this . mySquads ( ) ) ;
572575 }
573576 const mvs = mvStr . split ( "," ) ;
577+ const exclude = new Set < string > ( ) ;
574578 for ( const mv of mvs ) {
575579 const [ from , to ] = mv . split ( "-" ) ;
576580 if ( from === undefined || from === "" ) { continue ; }
581+ exclude . add ( from ) ;
577582 // if a to is provided
578583 if ( to !== undefined && to . length > 0 ) {
579584 // move the squad
@@ -590,7 +595,7 @@ export class MoonSquadGame extends GameBase {
590595 this . highlights = [ from ] ;
591596 const islands = this . getIslands ( ) ;
592597 const group = islands . find ( x => x . includes ( from ) ) ! ;
593- this . dots = group . filter ( g => g !== from && ! this . squads . has ( g ) ) ;
598+ this . dots = group . filter ( g => g !== from && ! this . squads . has ( g ) && ! exclude . has ( g ) ) ;
594599 }
595600 }
596601 }
0 commit comments