v3f(0, 0, 0), // velocity
camera->getDirection(),
camera->getCameraNode()->getUpVector());
- sound->setListenerGain(g_settings->getFloat("sound_volume"));
+
+ // Check if volume is in the proper range, else fix it.
+ float old_volume = g_settings->getFloat("sound_volume");
+ float new_volume = rangelim(old_volume, 0.0f, 1.0f);
+ sound->setListenerGain(new_volume);
+
+ if (old_volume != new_volume) {
+ g_settings->setFloat("sound_volume", new_volume);
+ }
LocalPlayer *player = client->getEnv().getLocalPlayer();
Remove stuff
*/
removeChildren();
-
+
/*
Calculate new sizes and positions
*/
screensize.X/2 + 380/2,
screensize.Y/2 + 200/2
);
-
+
DesiredRect = rect;
recalculateAbsolutePosition(false);
v2s32 size = rect.getSize();
- v2s32 topleft_client(40, 0);
int volume = (int)(g_settings->getFloat("sound_volume")*100);
/*
Add stuff