Add code that forces an error if compiled in LSO to all scripts

This should prevent accidents when saving in inventory in the official viewer.
This commit is contained in:
Sei Lisa 2018-05-18 00:28:02 +02:00 committed by Sei-Lisa
parent 9c84243390
commit f1ec6bde26
22 changed files with 46 additions and 32 deletions

View file

@ -17,9 +17,9 @@
string product = "AVsitter2 MLP converter";
string version = "2.2";
string notecard_basename = "AVpos";
list NOTECARDS;
list PROPS_NOTECARDS;
string notecard_name;
list NOTECARDS = [notecard_name]; //OSS::list NOTECARDS; // Force error in LSO
list PROPS_NOTECARDS;
key notecard_query;
integer notecard_line;
integer notecard_pointer;
@ -98,6 +98,7 @@ default
{
Out(0, "Reading MLP notecards...");
Readout_Say(" ");
NOTECARDS = [];
get_notecards();
if (llGetListLength(NOTECARDS) > 0)
{

View file

@ -17,7 +17,7 @@
string notecard_basename = "AVpos";
integer variable1;
key notecard_query;
list ALL_USED_ANIMS;
list ALL_USED_ANIMS = [notecard_query]; //OSS::list ALL_USED_ANIMS; // Force error in LSO
list UNUSED_ANIMS;
integer NOT_FOUND_COUNT;
integer IS_VARIABLE_SPEED_SUBMENU;
@ -43,6 +43,7 @@ default
{
state_entry()
{
ALL_USED_ANIMS = [];
if (llGetInventoryType(notecard_basename) == INVENTORY_NOTECARD)
{
Owner_Say(" ");
@ -65,9 +66,9 @@ default
if (query_id == notecard_query)
{
if (data == EOF)
{
{
if(!NOT_FOUND_COUNT){
Owner_Say("All anims referenced in the notecard were accounted for.");
Owner_Say("All anims referenced in the notecard were accounted for.");
}
else{
Owner_Say("Anims were used in the notecard but not found in inventory!");
@ -78,7 +79,7 @@ default
integer index;
integer isVariableSpeed;
string anim_basename = llGetInventoryName(INVENTORY_ANIMATION, i);
if(llListFindList(["+","-"], [llGetSubString(anim_basename, -1, -1)]) != -1)
{
index = llListFindList(ALL_USED_ANIMS, [llDeleteSubString(anim_basename,-1,-1)]);
@ -89,9 +90,9 @@ default
isVariableSpeed=TRUE;
}
}
index = llListFindList(ALL_USED_ANIMS, [anim_basename]);
if (index == -1 && llGetInventoryName(INVENTORY_ANIMATION, i) != "AVhipfix")
{
Owner_Say("Animation '" + llGetInventoryName(INVENTORY_ANIMATION, i) + "' found in inventory but not used in notecard!");
@ -138,7 +139,7 @@ default
Owner_Say("Variable-Speed Animation '" + llList2String(anims, i) + "-' not found in inventory!");
}
}
integer index = llListFindList(ALL_USED_ANIMS,[llList2String(anims, i)]);
if(index == -1){ //only add to the list if the anim has not appeared before
ALL_USED_ANIMS += llList2String(anims, i);
@ -146,9 +147,9 @@ default
}
else if(IS_VARIABLE_SPEED_SUBMENU == TRUE){
// prevent variable-Speed anims from being incorrectly tagged as surplus in cases where: they are included in multiple submenus/sitters and where only in some places the submenus aren't set as Variable-Speed submenus.
// ensure it stays TRUE if ANY of the submenus that the anim is used in are set as Variable-Speed submenus.
// ensure it stays TRUE if ANY of the submenus that the anim is used in are set as Variable-Speed submenus.
VARIABLE_SPEED_ANIMS=llListReplaceList(VARIABLE_SPEED_ANIMS,[TRUE],index,index);
}
}
}
}
else if (command == "MENU" || command == "SITTER")

View file

@ -16,10 +16,9 @@
/*
* Things not implemented:
* ~ perms of the object
* ~ creator of the object
* ~ which platform/world (OpenSim/SL)
*/
* ~ which platform/world (OpenSim/SL) and version
*/
integer sendToSupport=FALSE;
integer sendItems = TRUE;