diff --git a/src/nitro/room/object/visualization/pet/PetVisualization.ts b/src/nitro/room/object/visualization/pet/PetVisualization.ts index f6a0bfdd..3051ea03 100644 --- a/src/nitro/room/object/visualization/pet/PetVisualization.ts +++ b/src/nitro/room/object/visualization/pet/PetVisualization.ts @@ -122,34 +122,33 @@ export class PetVisualization extends FurnitureAnimatedVisualization if(this.updateModelCounter === model.updateCounter) return false; - // _local_4 = _local_3.getString(RoomObjectVariableEnum.FIGURE_POSTURE); - // _local_5 = _local_3.getString(RoomObjectVariableEnum.FIGURE_GESTURE); - // _local_6 = _local_3.getNumber(RoomObjectVariableEnum.FIGURE_POSTURE); - // if (!isNaN(_local_6)) - // { - // _local_16 = this._animationData._Str_17398(_Str_3289); - // if (_local_16 > 0) - // { - // _local_4 = this._animationData.animationToPosture(_Str_3289, (_local_6 % _local_16), true); - // _local_5 = null; - // } - // } - // _local_7 = _local_3.getNumber(RoomObjectVariableEnum.FIGURE_GESTURE); - // if (!isNaN(_local_7)) - // { - // _local_17 = this._animationData._Str_16869(_Str_3289); - // if (_local_17 > 0) - // { - // _local_5 = this._animationData.animationToGesture(_Str_3289, (_local_7 % _local_17)); - // } - // } - // this._Str_14314(_local_4, _local_5); + let posture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); + let gesture = model.getValue(RoomObjectVariable.FIGURE_GESTURE); + const tempPosture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); + if(!isNaN(tempPosture)) + { + const totalPostures = this._data.totalPostures(this._scale); - const posture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); - const gesture = model.getValue(RoomObjectVariable.FIGURE_GESTURE); - const tempPosture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); + if(totalPostures > 0) + { + posture = this._data.animationToPosture(this._scale, (tempPosture % totalPostures), true); + gesture = null; + } + } + + const tempGesture = model.getValue(RoomObjectVariable.FIGURE_GESTURE); + + if(!isNaN(tempGesture)) + { + const totalGestures = this._data.totalGestures(this._scale); + + if(totalGestures > 0) + { + gesture = this._data.animationToGesture(this._scale, (tempGesture % totalGestures)); + } + } this.setPostureAndGesture(posture, gesture);