Improve OpenSim-friendliness.

This commit is contained in:
Sei Lisa 2017-10-31 23:17:38 +01:00 committed by Sei-Lisa
parent bf8f10bfe6
commit 08263c921e
8 changed files with 42 additions and 42 deletions

View file

@ -241,7 +241,7 @@ default
camera_triggers += part0; camera_triggers += part0;
camera_settings += part1; camera_settings += part1;
} }
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1); notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
} }
} }
} }

View file

@ -198,7 +198,7 @@ rlv_top_menu()
list menu_items; list menu_items;
string text = "RLV for " + slaveName; string text = "RLV for " + slaveName;
list extra; list extra;
if (llGetListLength(SITTING_AVATARS) > 1 || ~llListFindList(DESIGNATIONS_NOW, ["S"])) if (llGetListLength(SITTING_AVATARS) > 1 || llListFindList(DESIGNATIONS_NOW, ["S"]) != -1)
{ {
extra += "[BACK]"; extra += "[BACK]";
} }
@ -209,7 +209,7 @@ rlv_top_menu()
{ {
if (slaveWearingRelay) if (slaveWearingRelay)
{ {
if (~designationIndex && llList2String(SITTER_DESIGNATIONS_MASTER, designationIndex) == "D") if (designationIndex != -1 && llList2String(SITTER_DESIGNATIONS_MASTER, designationIndex) == "D")
{ {
text = slaveName + " has not chosen submissive role."; text = slaveName + " has not chosen submissive role.";
} }
@ -316,13 +316,13 @@ stop()
release(key SLAVE, integer allowUnsit) release(key SLAVE, integer allowUnsit)
{ {
integer index = llListFindList(CAPTIVES, [SLAVE]); integer index = llListFindList(CAPTIVES, [SLAVE]);
if (~index) if (index != -1)
{ {
CAPTIVES = llDeleteSubList(CAPTIVES, index - 1, index); CAPTIVES = llDeleteSubList(CAPTIVES, index - 1, index);
llSay(0, llKey2Name(SLAVE) + " was released."); llSay(0, llKey2Name(SLAVE) + " was released.");
relay(SLAVE, baseReleaseRestrictions); relay(SLAVE, baseReleaseRestrictions);
relay(SLAVE, "!release"); relay(SLAVE, "!release");
if (allowUnsit && ~llSubStringIndex(baseReleaseRestrictions, "@unsit=force")) if (allowUnsit && llSubStringIndex(baseReleaseRestrictions, "@unsit=force") != -1)
{ {
llUnSit(SLAVE); llUnSit(SLAVE);
} }
@ -381,7 +381,7 @@ get_unique_channels()
RELAY_CHECK_CHANNEL = RELAY_SEARCH_CHANNEL + 4; RELAY_CHECK_CHANNEL = RELAY_SEARCH_CHANNEL + 4;
ASKROLE_CHANEL = ((integer)llFrand(0x7FFFFF80) + 1) * -1; // 7FFFFF80 = max float < 2^31 ASKROLE_CHANEL = ((integer)llFrand(0x7FFFFF80) + 1) * -1; // 7FFFFF80 = max float < 2^31
llListenRemove(relay_handle); llListenRemove(relay_handle);
relay_handle = llListen(RELAY_CHANNEL, "", "", ping = "ping," + (string)llGetKey() + ",ping,ping"); relay_handle = llListen(RELAY_CHANNEL, "", "", (ping = "ping," + (string)llGetKey() + ",ping,ping"));
} }
check_submissive() check_submissive()
@ -415,7 +415,7 @@ select_submissive_rlv()
{ {
text = "There are no submissives sitting."; text = "There are no submissives sitting.";
} }
if (~llListFindList(DESIGNATIONS_NOW, ["S"]) && llGetListLength(SITTING_AVATARS) < llGetListLength(DESIGNATIONS_NOW)) if (llListFindList(DESIGNATIONS_NOW, ["S"]) != -1 && llGetListLength(SITTING_AVATARS) < llGetListLength(DESIGNATIONS_NOW))
{ {
text += "\n\nCapture = trap a new avatar."; text += "\n\nCapture = trap a new avatar.";
menu_items += "Capture..."; menu_items += "Capture...";
@ -431,10 +431,10 @@ select_submissive_rlv()
find_seat(key id, integer index, string msg, integer captureSub) find_seat(key id, integer index, string msg, integer captureSub)
{ {
if (~index) if (index != -1)
{ {
integer first_available = index; integer first_available = index;
if (~llListFindList(DESIGNATIONS_NOW, [id])) if (llListFindList(DESIGNATIONS_NOW, [id]) != -1)
{ {
first_available = llListFindList(DESIGNATIONS_NOW, [id]); first_available = llListFindList(DESIGNATIONS_NOW, [id]);
} }
@ -442,7 +442,7 @@ find_seat(key id, integer index, string msg, integer captureSub)
{ {
first_available = llListFindList(DESIGNATIONS_NOW, [llGetSubString(msg, 0, 0)]); first_available = llListFindList(DESIGNATIONS_NOW, [llGetSubString(msg, 0, 0)]);
} }
if (~first_available) if (first_available != -1)
{ {
if (msg == "Dominant") if (msg == "Dominant")
{ {
@ -568,7 +568,7 @@ ask_role(key id)
back(key id) back(key id)
{ {
if (~llListFindList(SITTING_AVATARS, [id])) if (llListFindList(SITTING_AVATARS, [id]) != -1)
{ {
llMessageLinked(LINK_SET, 90005, "", id); llMessageLinked(LINK_SET, 90005, "", id);
} }
@ -581,7 +581,7 @@ back(key id)
integer isSub(key id) integer isSub(key id)
{ {
integer index = llListFindList(DESIGNATIONS_NOW, [id]); integer index = llListFindList(DESIGNATIONS_NOW, [id]);
if (~index) if (index != -1)
{ {
if (llList2String(SITTER_DESIGNATIONS_MASTER, index) == "S") if (llList2String(SITTER_DESIGNATIONS_MASTER, index) == "S")
{ {
@ -671,7 +671,7 @@ state running
SITTING_AVATARS += id; SITTING_AVATARS += id;
if (onSit == "CAPTURE" || (string)CONTROLLER + (string)id == PairWhoStartedCapture) if (onSit == "CAPTURE" || (string)CONTROLLER + (string)id == PairWhoStartedCapture)
{ {
if (~llListFindList(DESIGNATIONS_NOW, ["S"])) if (llListFindList(DESIGNATIONS_NOW, ["S"]) != -1)
{ {
find_seat(id, (integer)msg, "Submissive", TRUE); find_seat(id, (integer)msg, "Submissive", TRUE);
} }
@ -687,7 +687,7 @@ state running
{ {
index = (integer)msg; index = (integer)msg;
} }
if (~index) if (index != -1)
{ {
DESIGNATIONS_NOW = llListReplaceList(DESIGNATIONS_NOW, [id], (integer)msg, (integer)msg); DESIGNATIONS_NOW = llListReplaceList(DESIGNATIONS_NOW, [id], (integer)msg, (integer)msg);
} }
@ -697,12 +697,12 @@ state running
{ {
playpose(WAITPOSE, msg); playpose(WAITPOSE, msg);
integer index = llListFindList(SITTING_AVATARS, [id]); integer index = llListFindList(SITTING_AVATARS, [id]);
if (~index) if (index != -1)
{ {
SITTING_AVATARS = llDeleteSubList(SITTING_AVATARS, index, index); SITTING_AVATARS = llDeleteSubList(SITTING_AVATARS, index, index);
} }
index = llListFindList(DESIGNATIONS_NOW, [id]); index = llListFindList(DESIGNATIONS_NOW, [id]);
if (~index) if (index != -1)
{ {
DESIGNATIONS_NOW = llListReplaceList(DESIGNATIONS_NOW, llList2List(SITTER_DESIGNATIONS_MASTER, index, index), index, index); DESIGNATIONS_NOW = llListReplaceList(DESIGNATIONS_NOW, llList2List(SITTER_DESIGNATIONS_MASTER, index, index), index, index);
llMessageLinked(LINK_THIS, 90206, llDumpList2String(DESIGNATIONS_NOW, "|"), ""); llMessageLinked(LINK_THIS, 90206, llDumpList2String(DESIGNATIONS_NOW, "|"), "");
@ -710,7 +710,7 @@ state running
} }
else if (num == 90012) else if (num == 90012)
{ {
if (~llListFindList(CAPTIVES, [id])) if (llListFindList(CAPTIVES, [id]) != -1)
{ {
if (subControl) if (subControl)
{ {
@ -745,9 +745,9 @@ state running
{ {
integer designationIndex = llListFindList(DESIGNATIONS_NOW, [id]); integer designationIndex = llListFindList(DESIGNATIONS_NOW, [id]);
integer isSittingIndex = llListFindList(SITTING_AVATARS, [id]); integer isSittingIndex = llListFindList(SITTING_AVATARS, [id]);
if (~isSittingIndex) if (isSittingIndex != -1)
{ {
if (RLV_ON && ~designationIndex && llList2String(SITTER_DESIGNATIONS_MASTER, designationIndex) == "S") if (RLV_ON && designationIndex != -1 && llList2String(SITTER_DESIGNATIONS_MASTER, designationIndex) == "S")
{ {
if (subControl) if (subControl)
{ {
@ -784,7 +784,7 @@ state running
} }
if (controllerHasKeys && id != CONTROLLER) if (controllerHasKeys && id != CONTROLLER)
{ {
if (~isSittingIndex) if (isSittingIndex != -1)
{ {
if (llList2String(SITTER_DESIGNATIONS_MASTER, designationIndex) == "D") if (llList2String(SITTER_DESIGNATIONS_MASTER, designationIndex) == "D")
{ {
@ -832,7 +832,7 @@ state running
} }
else if (num == 90211) else if (num == 90211)
{ {
if (~llListFindList(DESIGNATIONS_NOW, ["S"])) if (llListFindList(DESIGNATIONS_NOW, ["S"]) != -1)
{ {
new_controller(id); new_controller(id);
start_relay_search(); start_relay_search();
@ -844,7 +844,7 @@ state running
{ {
if (channel == ASKROLE_CHANEL) if (channel == ASKROLE_CHANEL)
{ {
if (~llListFindList(SITTING_AVATARS, [id])) if (llListFindList(SITTING_AVATARS, [id]) != -1)
{ {
integer index = llListFindList(SITTERS, [(string)id]); integer index = llListFindList(SITTERS, [(string)id]);
find_seat(id, index, msg, captureOnAsk); find_seat(id, index, msg, captureOnAsk);
@ -854,7 +854,7 @@ state running
{ {
key newSlave = llGetOwnerKey(id); key newSlave = llGetOwnerKey(id);
string newSlaveName = llKey2Name(newSlave); string newSlaveName = llKey2Name(newSlave);
if (~llListFindList(SITTING_AVATARS, [newSlave])) if (llListFindList(SITTING_AVATARS, [newSlave]) != -1)
{ {
if (!llGetListLength(CAPTIVES)) if (!llGetListLength(CAPTIVES))
{ {
@ -891,11 +891,11 @@ state running
if (msg == ping) if (msg == ping)
{ {
integer index = llListFindList(CAPTIVES, [llGetOwnerKey(id)]); integer index = llListFindList(CAPTIVES, [llGetOwnerKey(id)]);
if (~index) if (index != -1)
{ {
if (autoRecapture) if (autoRecapture)
{ {
if (~llListFindList(DESIGNATIONS_NOW, ["S"])) if (llListFindList(DESIGNATIONS_NOW, ["S"]) != -1)
{ {
if (CONTROLLER) // OSS::if (osIsUUID(CONTROLLER) && CONTROLLER != NULL_KEY) if (CONTROLLER) // OSS::if (osIsUUID(CONTROLLER) && CONTROLLER != NULL_KEY)
{ {
@ -949,7 +949,7 @@ state running
else if (menu == "SUB_SELECT") else if (menu == "SUB_SELECT")
{ {
integer index = llListFindList(SITTERS_SHORTNAMES, [msg]); integer index = llListFindList(SITTERS_SHORTNAMES, [msg]);
if (~index) if (index != -1)
{ {
SLAVE = llList2Key(SITTERS_MENUKEYS, index); SLAVE = llList2Key(SITTERS_MENUKEYS, index);
check_submissive(); check_submissive();
@ -962,7 +962,7 @@ state running
else if (menu == "SELECT") else if (menu == "SELECT")
{ {
integer index = llListFindList(DETECTED_AVATAR_SHORTNAMES, [msg]); integer index = llListFindList(DETECTED_AVATAR_SHORTNAMES, [msg]);
if (~index) if (index != -1)
{ {
if (llList2String(DETECTED_AVATAR_KEYS, index) == CONTROLLER) if (llList2String(DETECTED_AVATAR_KEYS, index) == CONTROLLER)
{ {
@ -977,7 +977,7 @@ state running
TimelockPaused = TRUE; TimelockPaused = TRUE;
llSetTimerEvent(0); llSetTimerEvent(0);
PairWhoStartedCapture = (string)CONTROLLER + llList2String(DETECTED_AVATAR_KEYS, index); PairWhoStartedCapture = (string)CONTROLLER + llList2String(DETECTED_AVATAR_KEYS, index);
if (~llListFindList(SITTING_AVATARS, [llList2Key(DETECTED_AVATAR_KEYS, index)])) if (llListFindList(SITTING_AVATARS, [llList2Key(DETECTED_AVATAR_KEYS, index)]) != -1)
{ {
capture_attempt(llList2Key(DETECTED_AVATAR_KEYS, index), ""); capture_attempt(llList2Key(DETECTED_AVATAR_KEYS, index), "");
} }
@ -1141,7 +1141,7 @@ state running
while (i >= 0) while (i >= 0)
{ {
key SLAVE = llList2Key(CAPTIVES, i); key SLAVE = llList2Key(CAPTIVES, i);
if (~llListFindList(SITTING_AVATARS, [SLAVE])) if (llListFindList(SITTING_AVATARS, [SLAVE]) != -1)
{ {
release(SLAVE, TRUE); release(SLAVE, TRUE);
} }

View file

@ -448,7 +448,7 @@ default
part1 = llList2String(anim_animsequences, x); part1 = llList2String(anim_animsequences, x);
anim_animsequences += part1; anim_animsequences += part1;
} }
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1); notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
} }
} }
} }

View file

@ -109,7 +109,7 @@ integer get_point(string text)
integer i; integer i;
for (i = 1; i < llGetListLength(ATTACH_POINTS); i = i + 2) for (i = 1; i < llGetListLength(ATTACH_POINTS); i = i + 2)
{ {
if (~llSubStringIndex(llToUpper(text), llToUpper(llList2String(ATTACH_POINTS, i)))) if (llSubStringIndex(llToUpper(text), llToUpper(llList2String(ATTACH_POINTS, i))) != -1)
{ {
return llList2Integer(ATTACH_POINTS, i - 1); return llList2Integer(ATTACH_POINTS, i - 1);
} }
@ -387,7 +387,7 @@ default
integer flag; integer flag;
for (; i < llGetListLength(SITTERS); i++) for (; i < llGetListLength(SITTERS); i++)
{ {
if (~llListFindList(prop_triggers, [(string)i + "|" + msg])) if (llListFindList(prop_triggers, [(string)i + "|" + msg]) != -1)
{ {
flag = TRUE; flag = TRUE;
} }
@ -440,7 +440,7 @@ default
remove_props_by_sitter(msg, FALSE); remove_props_by_sitter(msg, FALSE);
remove_worn(id); remove_worn(id);
integer index = llListFindList(SITTERS, [id]); integer index = llListFindList(SITTERS, [id]);
if (~index) if (index != -1)
{ {
SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index); SITTERS = llListReplaceList(SITTERS, [NULL_KEY], index, index);
} }
@ -650,7 +650,7 @@ default
{ {
WARN = (integer)llList2String(parts, 0); WARN = (integer)llList2String(parts, 0);
} }
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1); notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
} }
} }
} }

View file

@ -236,7 +236,7 @@ default
{ {
Readout_Say(data); Readout_Say(data);
} }
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1); notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
} }
} }
} }

View file

@ -122,16 +122,16 @@ default
{ {
if (llGetListLength(NOTECARDS) - notecard_pointer > 1) if (llGetListLength(NOTECARDS) - notecard_pointer > 1)
{ {
notecard_name = llList2String(NOTECARDS, notecard_pointer += 1); notecard_name = llList2String(NOTECARDS, ++notecard_pointer);
notecard_query = llGetNotecardLine(notecard_name, notecard_line = 0); notecard_query = llGetNotecardLine(notecard_name, (notecard_line = 0));
} }
else if (animator_count + 1 < animator_total) else if (animator_count + 1 < animator_total)
{ {
animator_count++; animator_count++;
Readout_Say(" "); Readout_Say(" ");
Readout_Say("SITTER " + (string)animator_count); Readout_Say("SITTER " + (string)animator_count);
notecard_name = llList2String(NOTECARDS, notecard_pointer = 0); notecard_name = llList2String(NOTECARDS, (notecard_pointer = 0));
notecard_query = llGetNotecardLine(notecard_name, notecard_line = 0); notecard_query = llGetNotecardLine(notecard_name, (notecard_line = 0));
} }
else else
{ {
@ -196,7 +196,7 @@ default
} }
} }
} }
notecard_query = llGetNotecardLine(notecard_name, notecard_line += 1); notecard_query = llGetNotecardLine(notecard_name, ++notecard_line);
} }
} }
} }

View file

@ -102,7 +102,7 @@ default
ALL_USED_ANIMATIONS += llList2String(anims, i); ALL_USED_ANIMATIONS += llList2String(anims, i);
} }
} }
notecard_query = llGetNotecardLine(notecard_basename, variable1 += 1); notecard_query = llGetNotecardLine(notecard_basename, ++variable1);
} }
} }
} }

View file

@ -243,7 +243,7 @@ default
} }
} }
} }
notecard_query = llGetNotecardLine(notecard_name, (variable1 += 1)); notecard_query = llGetNotecardLine(notecard_name, ++variable1);
} }
} }
} }