DIRECTOR: Fix calling of Beep

- Converts beep called with zero args to beep(1)
- Beep arg starts counting at 1.
This commit is contained in:
Roland van Laar 2019-12-22 17:08:09 +01:00 committed by Eugene Sandulenko
parent a9e07c314f
commit b5ff682fd2
2 changed files with 7 additions and 3 deletions

View File

@ -1542,8 +1542,12 @@ void Lingo::b_union(int nargs) {
// Sound
///////////////////
void Lingo::b_beep(int nargs) {
Datum d = g_lingo->pop();
g_lingo->func_beep(d.u.i);
int repeat = 1;
if (nargs == 1) {
Datum d = g_lingo->pop();
repeat = d.u.i;
}
g_lingo->func_beep(repeat);
}
void Lingo::b_mci(int nargs) {

View File

@ -355,7 +355,7 @@ void Lingo::func_cursor(int c) {
}
void Lingo::func_beep(int repeats) {
for (int r = 0; r <= repeats; r++)
for (int r = 1; r <= repeats; r++)
_vm->getSoundManager()->systemBeep();
}