BUTTON is documented to pass the UUIDs of the controller *and* the sitter when they are different, separated by a "|".
ADJUST is not documented to do that (yet), but it behaves that way.
Both behaviours are undesirable for generic scripts that respond to a link message without being specifically designed for AVsitter, because they don't expect the extra UUID. This can be seen as an AVsitter shortcoming, therefore we implement backwards-compatible workarounds.
For ADJUST, the AMENU argument's range has been extended:
0, 1 and 2 behave the same as before.
4, 5 and 6 behave as 0, 1 and 2 respectively, but also inhibit sending the second UUID.
For BUTTON, two special values have been added for the ID field: <C> and <S>, which will be replaced with CONTROLLER and SITTER respectively. For example:
BUTTON text|num|str
behaves the same as before, sending both CONTROLLER and SITTER in the UUID field when they differ; however:
BUTTON text|num|str|<C>
always passes only the UUID of the person who controls the menu. Similarly for <S>.
Follow-up to a65d7cd, which failed for the main menu. That's because current_menu is -1 for the main menu.
Since current menu is either -1 or points to a MENU entry, it's safe to add 1 to it and bring it to a correct range.
While on it, remove redundant `if`.
Per bug report by RiderDavis.
Fixes#95.
When the same BUTTON appears in different submenus, with different parameters, pressing it always picked the one that appeared first in the notecard.
Fix that by making the search start at the current menu.
Per bug report by AceyXx.
llGetSubString("abc", 3, -1) gives "abc"; llList2List(L, 1, -1) gives L when L has length 1. In general, llGetSubString or llList2List return the whole thing when the starting index is grater than the last element in the list.
There were a number of spots with that hazard, so fix all we found.
It should help ensuring that you have the right script contents when saving. It also provides a short description, to get a rough idea of what it's about.
The only code change is the product name in [AV]xcite! to add a TM symbol to Xcite!
Use a global variable instead. In SL, the optimizer does the replacement automatically, therefore no memory penalty is incurred. In OpenSim, the variable is assigned at run time with llUnescapeURL. The OpenSim separator is also changed from U+001F to U+007F, because most control characters under U+0020 cause problems with exporting when present in script memory.
Fixes#41.
We knew that in OpenSim, the bitwise NOT "~" operator's precedence was broken (see <http://opensimulator.org/mantis/view.php?id=3268>), but it appears that the same bug affects the logical NOT operator "!" as well, so it needs parentheses when followed by more expressions.
- Add Makefile and release creation instructions.
- Add a simple Python program to automate the OpenSim conversion based on markings in the code.
- Add .gitignore entries for the generated files.
- Add parentheses around assignments as required by OpenSim. This is done only to the core scripts.
- OpenSim isn't compatible with SL when there are conditions of type key. Those are all converted. Conditions of other types, except integer, are expanded for clarity and optimization, as they generate the same or better code that way, and currently the optimizer can do a better job when they are expanded.
- Floats in scientific notation need a dot.
- llParseStringXXXX doesn't work the same in OpenSim as in SL, when the separator is an Unicode codepoint that doesn't represent a character. For that reason, the internal separator, which is U+FFFD ("Replacement Character") is changed automatically by the Python program to U+001F (Unit Separator control character). For further safety, function strReplace is altered to use osReplaceString instead of llParseStringKeepNulls/llDumpList2String.
Furthermore, the ~ operator has the wrong precedence in OpenSim, but that was handled by a previous commit. Note that appearances of the ~ operator that were not preceded by a ! have only been replaced in the core scripts.
- Bump version of [AV]faces to 2.2.
- With very bad luck, some channel numbers could overflow the range of an integer due to float rounding, and produce DEBUG_CHANNEL or PUBLIC_CHANNEL as output.
- If both CHANGED_INVENTORY and CHANGED_LINK came at the same time, [AV]prop would fail to handle both.
- There was code that did nothing in [AV]faces. While it caused no bug per se, if it was reused in future then it could be affected by the same problem as that in [AV]prop.
Many of them cause problems with OpenSim.
All of them are applied by the optimizer, except (str="")+str, which produces gains only in LSO, not in Mono, and doesn't work in OpenSim.
A few are undone only for clarity, relying on the fact that the optimizer will apply them again.
- Add spaces between functions.
- Add comments on numeric codes and a few others.
- Reformat lists and one function.
- Remove spaces at EOL.
- Use actual copyright symbol.