Rave glove: Fix initialization issues and activate mode switch.

Note that this change will have no effect until the Avatar Mixer gets it, because the mixer will continue to send "glove mode 0" until it receives this update.
This commit is contained in:
Eric Johnston 2013-08-06 11:59:58 -07:00
parent fc23eaa825
commit ab31c3f82d
2 changed files with 8 additions and 3 deletions

View file

@ -54,7 +54,7 @@ void Hand::reset() {
void Hand::simulate(float deltaTime, bool isMine) {
if (_isRaveGloveActive) {
if (_raveGloveEffectsModeChanged) {
if (_raveGloveEffectsModeChanged && _raveGloveInitialized) {
activateNewRaveGloveMode();
_raveGloveEffectsModeChanged = false;
}
@ -363,6 +363,10 @@ void Hand::updateRaveGloveParticles(float deltaTime) {
// The rave glove mode has changed, so activate the effects.
void Hand::activateNewRaveGloveMode() {
if (!_raveGloveInitialized) {
return;
}
int mode = _raveGloveEffectsMode;
_raveGloveParticleSystem.killAllParticles();

View file

@ -161,8 +161,9 @@ int HandData::decodeRemoteData(unsigned char* sourceBuffer) {
}
setRaveGloveActive((gloveFlags & GLOVE_FLAG_RAVE) != 0);
// Jeffrey: uncomment this to test locally, before unrolling it to the team.
// setRaveGloveMode(effectsMode);
if (numHands > 0) {
setRaveGloveMode(effectsMode);
}
// One byte for error checking safety.
unsigned char requiredLength = (unsigned char)(sourceBuffer - startPosition);