-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ | |
@author: Zai Dium | ||
@update: 2022-02-16 | ||
@version: 1.19 | ||
@revision: 995 | ||
@revision: 1061 | ||
@localfile: ?defaultpath\Chess\[email protected] | ||
@license: MIT | ||
@license: by-nc-sa [https://creativecommons.org/licenses/by-nc-sa/4.0/] | ||
@notice: | ||
|
@@ -408,7 +408,7 @@ resized() | |
unit.y = size.y / 8; | ||
} | ||
|
||
touched(vector p) { | ||
touch_xy(vector p) { | ||
list values = llGetLinkPrimitiveParams(LINK_THIS, [PRIM_POSITION, PRIM_ROTATION]); | ||
vector center = llList2Vector(values, 0); | ||
p = (p - center) / llList2Rot(values, 1); | ||
|
@@ -686,16 +686,16 @@ default | |
showDialog(id); | ||
else if (link == 1) { //* 1 is the root CheadBoard | ||
vector p = llDetectedTouchPos(0); | ||
touched(p); | ||
touch_xy(p); | ||
} | ||
else //* a Piece touched | ||
else //* a Piece touch_xy | ||
{ | ||
list l = llGetLinkPrimitiveParams(link, [PRIM_NAME, PRIM_POSITION]); | ||
string name = llList2String(l, 0); | ||
if (llListFindList(fenNames, [name])>=0) //* only chess pieces can move | ||
{ | ||
vector pos = llList2Vector(l, 1); | ||
touched(pos); | ||
touch_xy(pos); | ||
} | ||
} | ||
} | ||
|
@@ -813,4 +813,4 @@ default | |
} | ||
} | ||
} | ||
} | ||
} |