diff --git a/ChessBoard.lsl b/ChessBoard.lsl index b705fb9..f6424b6 100644 --- a/ChessBoard.lsl +++ b/ChessBoard.lsl @@ -4,7 +4,7 @@ @author: Zai Dium @update: 2022-02-16 - @revision: 265 + @revision: 276 @localfile: ?defaultpath\Chess\?@name.lsl @license: MIT @@ -235,7 +235,14 @@ resetBoard() } clearBoard(){ -// llMessageLinked(LINK_ALL_CHILDREN, 0, "die", NULL_KEY); + integer c = llGetNumberOfPrims(); + integer i = 1; //based on 1 + while(i <= c) + { + if (llListFindList(pc, [llGetLinkName(i)])) //* llGetLinkName based on 1 + llBreakLink(i); + i++; + } } resized() diff --git a/Piece.lsl b/Piece.lsl index f92adba..898a83f 100644 --- a/Piece.lsl +++ b/Piece.lsl @@ -2,7 +2,7 @@ @name: Piece @author: Zai Dium @update: 2022-02-16 - @revision: 223 + @revision: 240 @localfile: ?defaultpath\Chess\?@name.lsl */ @@ -49,14 +49,15 @@ default llMessageLinked(LINK_ROOT, llGetStartParameter(), "touch", llGetKey()); } - link_message( integer sender_num, integer num, string str, key id ) + changed(integer change) { - if (str=="die") + if (change & CHANGED_LINK) { - if (llGetStartParameter()>0) - { + if (llGetKey() == llGetLinkKey(LINK_ROOT)) { + llOwnerSay("Die"); //llDie(); } } } + }