Browse code

[NCSF] Minor correction to the attack rate calculation.

(Basically, it should never allow the same volume level as the previous
calculation.)

Naram Qashat authored on 2014/10/22 17:55:03
Showing 1 changed files
... ...
@@ -445,9 +445,10 @@ void Channel::Update()
445 445
 		case CS_ATTACK:
446 446
 		{
447 447
 			int newAmpl = this->ampl;
448
+			int oldAmpl = this->ampl >> 7;
448 449
 			do
449 450
 				newAmpl = (newAmpl * static_cast<int>(this->attackLvl)) / 256;
450
-			while (newAmpl == this->ampl);
451
+			while ((newAmpl >> 7) == oldAmpl);
451 452
 			this->ampl = newAmpl;
452 453
 			if (!this->ampl)
453 454
 				this->state = CS_DECAY;