| 308 | } |
| 309 | |
| 310 | void CAmbientSoundPattern::OnOK() { |
| 311 | // Verify probabilities |
| 312 | for (int p = 0; p < Num_ambient_sound_patterns; p++) { |
| 313 | asp *asp = &Ambient_sound_patterns[p]; |
| 314 | if (asp->num_sounds) { |
| 315 | int prob = 0; |
| 316 | |
| 317 | for (int s = 0; s < asp->num_sounds; s++) |
| 318 | prob += asp->sounds[s].probability; |
| 319 | |
| 320 | if (prob != 100) { |
| 321 | OutrageMessageBox("Error: the probabilities for pattern '%s' don't add up to 100.", asp->name); |
| 322 | return; |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | // Update the data |
| 328 | WriteAmbientData(); |
| 329 | |
| 330 | CDialog::OnOK(); |
| 331 | } |
| 332 | |
| 333 | void CAmbientSoundPattern::OnASPLock() { |
| 334 | int n; |
nothing calls this directly
no test coverage detected