mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 14:28:49 +02:00
Consolidate Clear Prox Code, Add Clear Prox to collisionWithEntity.
This commit is contained in:
parent
9ff68ce10c
commit
6892cdb57d
1 changed files with 15 additions and 9 deletions
|
@ -57,8 +57,6 @@
|
|||
}
|
||||
|
||||
function particleExplode() {
|
||||
Entities.deleteEntity(particleTrailEntity);
|
||||
particleTrailEntity = null;
|
||||
var entPos = Entities.getEntityProperties(_entityID, 'position').position;
|
||||
var props = {
|
||||
type: 'ParticleEffect',
|
||||
|
@ -110,7 +108,12 @@
|
|||
|
||||
|
||||
function clearProxCheck() {
|
||||
if (proxInterval) Script.clearInterval(proxInterval);
|
||||
if (proxInterval) {
|
||||
Script.clearInterval(proxInterval);
|
||||
Entities.deleteEntity(particleTrailEntity);
|
||||
particleTrailEntity = null;
|
||||
}
|
||||
|
||||
if (proxTimeout) Script.clearTimeout(proxTimeout);
|
||||
}
|
||||
|
||||
|
@ -118,8 +121,6 @@
|
|||
var ballPos = Entities.getEntityProperties(_entityID, ['position']).position;
|
||||
var isAnyAvatarInRange = AvatarList.isAvatarInRange(ballPos, 1);
|
||||
|
||||
if (particleTrailEntity === null) particleTrail();
|
||||
|
||||
if (isAnyAvatarInRange) {
|
||||
clearProxCheck();
|
||||
particleExplode();
|
||||
|
@ -143,14 +144,19 @@
|
|||
|
||||
this.releaseGrab = function (thisEntityID) {
|
||||
|
||||
if (particleTrailEntity === null) particleTrail();
|
||||
|
||||
Script.setTimeout(function () {
|
||||
proxInterval = Script.setInterval(proxCheck, 50);
|
||||
}, 150); // Setting a delay to give it time to leave initial avatar without proc.
|
||||
}, 200); // Setting a delay to give it time to leave initial avatar without proc.
|
||||
|
||||
proxTimeout = Script.setTimeout(function () {
|
||||
Script.clearInterval(proxInterval);
|
||||
Entities.deleteEntity(particleTrailEntity);
|
||||
clearProxCheck();
|
||||
}, 10000)
|
||||
}
|
||||
};
|
||||
|
||||
this.collisionWithEntity = function(thisEntityID, collisionEntityID, collisionInfo) {
|
||||
clearProxCheck();
|
||||
};
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue