2017-08-09 19:45:46 +02:00
|
|
|
# (C) Copyright 2015-2017 Sei Lisa. All rights reserved.
|
2015-03-05 23:18:41 +01:00
|
|
|
#
|
|
|
|
|
# This file is part of LSL PyOptimizer.
|
|
|
|
|
#
|
|
|
|
|
# LSL PyOptimizer is free software: you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# LSL PyOptimizer is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with LSL PyOptimizer. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
# Extra functions that have predictable return values for certain arguments.
|
|
|
|
|
|
2017-01-16 23:51:40 +01:00
|
|
|
from lslcommon import Key, Vector #, Quaternion
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
from lslbasefuncs import ELSLCantCompute, fi,ff,fs,fk,v2f,q2f,fl, \
|
|
|
|
|
NULL_KEY, ZERO_VECTOR, ZERO_ROTATION, \
|
2017-08-30 19:23:38 +02:00
|
|
|
TOUCH_INVALID_TEXCOORD, cond
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
ff, q2f # keep pyflakes happy as these are not used
|
2015-02-11 05:43:13 +01:00
|
|
|
|
|
|
|
|
TouchEvents = ('touch', 'touch_start', 'touch_end')
|
|
|
|
|
DetectionEvents = ('touch', 'touch_start', 'touch_end',
|
|
|
|
|
'collision', 'collision_start', 'collision_end',
|
|
|
|
|
'sensor')
|
2016-12-12 22:58:12 +01:00
|
|
|
GetEnvSettings = ('agent_limit', 'dynamic_pathfinding', 'estate_id',
|
|
|
|
|
'estate_name', 'frame_number', 'region_cpu_ratio', 'region_idle',
|
|
|
|
|
'region_product_name', 'region_product_sku', 'region_start_time',
|
|
|
|
|
'sim_channel', 'sim_version', 'simulator_hostname',
|
|
|
|
|
'region_max_prims', # <http://wiki.secondlife.com/wiki/Release_Notes/Second_Life_RC_Magnum/16#16.11.02.321369>
|
|
|
|
|
'region_object_bonus') # <http://wiki.secondlife.com/wiki/Release_Notes/Second_Life_RC_Magnum/16#16.12.03.322072>
|
2015-02-11 05:43:13 +01:00
|
|
|
|
2017-10-12 12:43:54 +02:00
|
|
|
xp_error_messages = {
|
|
|
|
|
-1:u'unknown error id',
|
|
|
|
|
0:u'no error', 1:u'exceeded throttle', 2:u'experiences are disabled',
|
|
|
|
|
3:u'invalid parameters', 4:u'operation not permitted',
|
|
|
|
|
5:u'script not associated with an experience', 6:u'not found',
|
|
|
|
|
7:u'invalid experience', 8:u'experience is disabled',
|
|
|
|
|
9:u'experience is suspended', 10:u'unknown error',
|
|
|
|
|
11:u'experience data quota exceeded',
|
|
|
|
|
12:u'key-value store is disabled',
|
|
|
|
|
13:u'key-value store communication failed', 14:u'key doesn\'t exist',
|
|
|
|
|
15:u'retry update', 16:u'experience content rating too high',
|
|
|
|
|
17:u'not allowed to run in current location',
|
|
|
|
|
18:u'experience permissions request timed out'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
valid_inventory_kinds = frozenset((0, 1, 3, 5, 6, 7, 10, 13, 20, 21))
|
|
|
|
|
|
2015-02-11 05:43:13 +01:00
|
|
|
def llCloud(v):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
v = v2f(v)
|
2015-02-11 05:43:13 +01:00
|
|
|
return 0.0
|
|
|
|
|
|
|
|
|
|
def llAvatarOnLinkSitTarget(link):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
link = fi(link)
|
2015-02-11 05:43:13 +01:00
|
|
|
if link > 255 or link == -2147483648:
|
|
|
|
|
return Key(NULL_KEY)
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2017-10-18 13:43:53 +02:00
|
|
|
# llClearPrimMedia always has side effects (emits errors for every face that
|
|
|
|
|
# is not supported)
|
|
|
|
|
def llClearLinkMedia(link, face):
|
|
|
|
|
if link > 255 or link == -2147483648:
|
|
|
|
|
return 0
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2015-02-11 05:43:13 +01:00
|
|
|
def llDetectedGrab(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event == 'touch' or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return ZERO_VECTOR
|
|
|
|
|
|
|
|
|
|
def llDetectedGroup(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
def llDetectedKey(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return Key(NULL_KEY)
|
|
|
|
|
|
|
|
|
|
def llDetectedLinkNumber(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
def llDetectedName(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
2017-09-22 14:17:56 +02:00
|
|
|
return NULL_KEY
|
2015-02-11 05:43:13 +01:00
|
|
|
|
|
|
|
|
def llDetectedOwner(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return Key(NULL_KEY)
|
|
|
|
|
|
|
|
|
|
def llDetectedPos(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return ZERO_VECTOR
|
|
|
|
|
|
|
|
|
|
def llDetectedRot(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return ZERO_ROTATION
|
|
|
|
|
|
|
|
|
|
def llDetectedTouchBinormal(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in TouchEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return ZERO_VECTOR
|
|
|
|
|
|
|
|
|
|
def llDetectedTouchFace(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in TouchEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
2017-08-30 19:23:38 +02:00
|
|
|
return -1 if event in DetectionEvents and 0 <= idx <= 15 else 0
|
2015-02-11 05:43:13 +01:00
|
|
|
|
|
|
|
|
def llDetectedTouchNormal(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in TouchEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return ZERO_VECTOR
|
|
|
|
|
|
|
|
|
|
def llDetectedTouchPos(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in TouchEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return ZERO_VECTOR
|
|
|
|
|
|
|
|
|
|
def llDetectedTouchST(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2017-10-18 17:40:25 +02:00
|
|
|
if 0 <= idx <= 15 and (event is None or event in DetectionEvents):
|
|
|
|
|
# In detection events that are not touch events, it returns
|
|
|
|
|
# TOUCH_INVALID_TEXCOORD if idx < num, else ZERO_VECTOR,
|
|
|
|
|
# but we only know that num >= 1.
|
|
|
|
|
if idx == 0 and event is not None and event not in TouchEvents:
|
|
|
|
|
# index 0 always exists, so we know the result
|
|
|
|
|
return TOUCH_INVALID_TEXCOORD
|
2015-02-11 05:43:13 +01:00
|
|
|
raise ELSLCantCompute
|
2017-10-18 17:40:25 +02:00
|
|
|
return ZERO_VECTOR
|
2015-02-11 05:43:13 +01:00
|
|
|
|
|
|
|
|
def llDetectedTouchUV(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2017-10-18 17:40:25 +02:00
|
|
|
if 0 <= idx <= 15 and (event is None or event in DetectionEvents):
|
|
|
|
|
# In detection events that are not touch events, it returns
|
|
|
|
|
# TOUCH_INVALID_TEXCOORD if idx < num, else ZERO_VECTOR,
|
|
|
|
|
# but we only know that num >= 1.
|
|
|
|
|
if idx == 0 and event is not None and event not in TouchEvents:
|
|
|
|
|
# index 0 always exists, so we know the result
|
|
|
|
|
return TOUCH_INVALID_TEXCOORD
|
2015-02-11 05:43:13 +01:00
|
|
|
raise ELSLCantCompute
|
2017-10-18 17:40:25 +02:00
|
|
|
return ZERO_VECTOR
|
2015-02-11 05:43:13 +01:00
|
|
|
|
|
|
|
|
def llDetectedType(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-11 05:43:13 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return 0
|
|
|
|
|
|
2015-02-12 07:49:32 +01:00
|
|
|
def llDetectedVel(idx, event=None):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
idx = fi(idx)
|
2015-02-12 07:49:32 +01:00
|
|
|
if 0 <= idx <= 15 and (event in DetectionEvents or event is None):
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
return ZERO_VECTOR
|
|
|
|
|
|
|
|
|
|
def llEdgeOfWorld(v1, v2):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
v1 = v2f(v1)
|
|
|
|
|
v2 = v2f(v2)
|
2017-01-16 19:34:04 +01:00
|
|
|
if v2[0] == v2[1] == 0:
|
2015-02-12 07:49:32 +01:00
|
|
|
return 1
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetAgentInfo(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2015-02-12 07:49:32 +01:00
|
|
|
if not cond(id):
|
|
|
|
|
return 0
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetAgentLanguage(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2015-02-12 07:49:32 +01:00
|
|
|
if not cond(id):
|
|
|
|
|
return u''
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2016-12-25 01:01:28 +01:00
|
|
|
def llGetAgentList(scope, options):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
scope = fi(scope)
|
|
|
|
|
options = fl(options)
|
2017-01-16 23:23:34 +01:00
|
|
|
if scope not in (1, 2, 4):
|
2015-02-12 07:49:32 +01:00
|
|
|
return [u'INVALID_SCOPE']
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetAgentSize(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2015-02-12 07:49:32 +01:00
|
|
|
if not cond(id):
|
|
|
|
|
return ZERO_VECTOR
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetAlpha(face):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
face = fi(face)
|
2015-02-12 07:49:32 +01:00
|
|
|
if face > 8:
|
|
|
|
|
return 1.0
|
2017-01-16 23:23:34 +01:00
|
|
|
# Negative face numbers return (float)llGetNumberOfSides(), which isn't
|
|
|
|
|
# computable.
|
2015-02-12 07:49:32 +01:00
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetAnimation(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2015-02-12 07:49:32 +01:00
|
|
|
if not cond(id):
|
|
|
|
|
return u''
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetAnimationList(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2015-02-12 07:49:32 +01:00
|
|
|
if not cond(id):
|
|
|
|
|
return []
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2017-10-18 21:57:33 +02:00
|
|
|
def llGetAttachedList(id):
|
|
|
|
|
id = fk(id)
|
|
|
|
|
if not cond(id):
|
|
|
|
|
return [u'NOT FOUND']
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2015-02-12 07:49:32 +01:00
|
|
|
def llGetBoundingBox(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2015-02-12 07:49:32 +01:00
|
|
|
if not cond(id):
|
|
|
|
|
return []
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2016-12-21 00:41:08 +01:00
|
|
|
def llGetColor(face):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
face = fi(face)
|
2015-02-12 07:49:32 +01:00
|
|
|
if face > 8:
|
2017-01-16 23:51:40 +01:00
|
|
|
return Vector((1.,1.,1.))
|
2017-10-20 09:58:49 +02:00
|
|
|
# Returns the average colour when negative (can't be computed)
|
2015-02-12 07:49:32 +01:00
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetDisplayName(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2015-02-12 07:49:32 +01:00
|
|
|
if not cond(id):
|
|
|
|
|
return u''
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2016-12-12 22:58:12 +01:00
|
|
|
def llGetEnv(s):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
s = fs(s)
|
2016-12-12 22:58:12 +01:00
|
|
|
if s not in GetEnvSettings:
|
|
|
|
|
return u""
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2017-10-12 12:43:54 +02:00
|
|
|
def llGetExperienceErrorMessage(errno):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
errno = fi(errno)
|
2017-10-12 12:43:54 +02:00
|
|
|
if errno < -1 or errno > 18:
|
|
|
|
|
errno = -1
|
|
|
|
|
return xp_error_messages[errno]
|
|
|
|
|
|
|
|
|
|
def llGetExperienceList(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2017-10-12 12:43:54 +02:00
|
|
|
# This function is not implemented and always returns empty list
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
def llGetHTTPHeader(id, s):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
|
|
|
|
s = fs(s)
|
2017-10-12 12:43:54 +02:00
|
|
|
if not cond(id):
|
|
|
|
|
return u''
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetInventoryKey(s):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
s = fs(s)
|
2017-10-12 12:43:54 +02:00
|
|
|
if s == u'':
|
|
|
|
|
return Key(NULL_KEY)
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetInventoryName(kind, index):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
kind = fi(kind)
|
|
|
|
|
index = fi(index)
|
2017-10-12 12:43:54 +02:00
|
|
|
if kind != -1 and kind not in valid_inventory_kinds or index < 0:
|
|
|
|
|
return u''
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetInventoryNumber(kind):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
kind = fi(kind)
|
2017-10-12 12:43:54 +02:00
|
|
|
if kind != -1 and kind not in valid_inventory_kinds:
|
|
|
|
|
return 0
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
def llGetInventoryPermMask(item, category):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
item = fs(item)
|
|
|
|
|
category = fi(category)
|
2017-10-12 12:43:54 +02:00
|
|
|
if category < 0 or category > 4 or item == u'':
|
|
|
|
|
return 0
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def llGetOwnerKey(id):
|
Change strategy for the checking of function input types.
Rather than assert that the types are correct, use the force type functions on the parameters:
ff, fk, fs, q2f, v2f, and the new fi, fl.
These functions have also been modified to ensure that the input type supports an implicit typecast to the target type and perform it, or emit ELSLInvalidType otherwise, rather than an assertion failure. fl in particular returns the original list if it isn't changed, or a copy if it is.
A couple bugs were found in testfuncs.py as a result, which have been fixed as well. A test has been added to ensure that the exception that caught these bugs remains in place.
The isxxxx functions are no longer necessary, so they are removed. Same goes for the painful cast handling process in foldconst, which was basically performing this task, and not necessarily well.
This approach is much more robust and should have been used since the beginning, but I didn't figure it out then.
2017-10-12 16:14:48 +02:00
|
|
|
id = fk(id)
|
2017-10-12 12:43:54 +02:00
|
|
|
if not cond(id):
|
|
|
|
|
return Key(NULL_KEY)
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2017-10-20 09:58:49 +02:00
|
|
|
def llGetStatus(mask):
|
|
|
|
|
# leave out STATUS_DIE_AT_EDGE and STATUS_CAST_SHADOWS
|
|
|
|
|
if (mask & 0b10101111111) == 0:
|
|
|
|
|
return 0
|
|
|
|
|
raise ELSLCantCompute
|
|
|
|
|
|
2015-03-05 23:18:41 +01:00
|
|
|
# TODO: Add more predictable functions.
|