mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:48:56 +02:00
- fix for multiple boppo's appearing after ESS restart (disconnect from message event instead of connect)
- default volume for sounds coming from ESS
This commit is contained in:
parent
a8740614e2
commit
b60534a855
1 changed files with 7 additions and 1 deletions
|
@ -26,6 +26,9 @@
|
||||||
var MESSAGE_HIT = 'hit';
|
var MESSAGE_HIT = 'hit';
|
||||||
var MESSAGE_ENTER_ZONE = 'enter-zone';
|
var MESSAGE_ENTER_ZONE = 'enter-zone';
|
||||||
var MESSAGE_UNLOAD_FIX = 'unload-fix';
|
var MESSAGE_UNLOAD_FIX = 'unload-fix';
|
||||||
|
|
||||||
|
var DEFAULT_SOUND_VOLUME = 0.6;
|
||||||
|
|
||||||
// don't set the search radius too high, it might remove boppo's from other nearby instances
|
// don't set the search radius too high, it might remove boppo's from other nearby instances
|
||||||
var BOPPO_SEARCH_RADIUS = 4.0;
|
var BOPPO_SEARCH_RADIUS = 4.0;
|
||||||
|
|
||||||
|
@ -116,6 +119,9 @@
|
||||||
|
|
||||||
var playSoundAtBoxingRing = function(sound, properties) {
|
var playSoundAtBoxingRing = function(sound, properties) {
|
||||||
var _properties = properties ? properties : {};
|
var _properties = properties ? properties : {};
|
||||||
|
if (_properties['volume'] === undefined) {
|
||||||
|
_properties['volume'] = DEFAULT_SOUND_VOLUME;
|
||||||
|
}
|
||||||
_properties['position'] = Entities.getEntityProperties(_entityID, ['position']).position;
|
_properties['position'] = Entities.getEntityProperties(_entityID, ['position']).position;
|
||||||
// play beep
|
// play beep
|
||||||
return Audio.playSound(sound, _properties);
|
return Audio.playSound(sound, _properties);
|
||||||
|
@ -285,7 +291,7 @@
|
||||||
if (_updateInterval) {
|
if (_updateInterval) {
|
||||||
Script.clearInterval(_updateInterval);
|
Script.clearInterval(_updateInterval);
|
||||||
}
|
}
|
||||||
Messages.messageReceived.connect(onMessage);
|
Messages.messageReceived.disconnect(onMessage);
|
||||||
Messages.unsubscribe(_channel);
|
Messages.unsubscribe(_channel);
|
||||||
Entities.deleteEntity(_boppoClownID);
|
Entities.deleteEntity(_boppoClownID);
|
||||||
print('endOfUnload');
|
print('endOfUnload');
|
||||||
|
|
Loading…
Reference in a new issue