Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leash particles persist forever in some cases due to an incorrect distance calculation in oc_particle that results in the LockGuard 'unlink' command being ignored #965

Closed
cudatox opened this issue Jul 23, 2023 · 2 comments
Assignees

Comments

@cudatox
Copy link

cudatox commented Jul 23, 2023

What version of OpenCollar are you using?
8.2.3

What behavior did you expect?
The collar should respond correctly to the 'unlink' command by removing the particles connecting the collar to the target

What behavior did you see instead?
The particles continue to persist forever

What steps does someone need to take to reproduce the problem?

This was tested using the LockGuard plugin for AVSitter 2.2. Simply sit on any piece of furniture that is using this plugin and is located far from the region origin. When you stand up, the collar will not unleash itself. I have also noted this issue on some furniture not using AVSitter.

The issue seems to lie in the manner in which the distance calculation is preformed in oc_particle (~line 756). On some furniture, LockGuard does not send the chain target (parsed into kLGTarget) when sending the unlink command to the collar. This results in kLGTarget being assigned NULL_KEY and when it is subsequently used in the distance calculation, it results in an incorrect distance value that may exceed the limit (g_iLeashLength). This usually results in the unlink command being ignored.

I was able to correct this issue in my experimentation by bypassing the leash length check for the unlink command, but I'm not sure what the other potential consequences of doing this would be:

               if(llVecDist(llGetPos(), (vector)llList2String(llGetObjectDetails(kLGTarget, [OBJECT_POS]),0)) > g_iLeashLength){
                    //Leash length is irrelevant for the unlink command
                    if (sLGCMD != "unlink"){
                        return;
                    }
                }
@Pingout
Copy link
Collaborator

Pingout commented Jul 23, 2023

This may also be a solution to #650

I will test it and report back

Pingout added a commit that referenced this issue Jul 23, 2023
Potentially a fix to #965 and #650
@SilkieSabra SilkieSabra moved this from New to In Progress in OpenCollar Issues Board Jul 24, 2023
@SilkieSabra SilkieSabra moved this from In Progress to Test and Report Progress in OpenCollar Issues Board Aug 4, 2023
@SilkieSabra SilkieSabra moved this from Test and Report Progress to Done in OpenCollar Issues Board Aug 4, 2023
@NikkiLacrima
Copy link
Contributor

Handled with PR #974

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants