Several small fixes to sound system:
* sample_play_id - Missing break caused output to use value from effect volume.
Following functions were missing s_OK return and would always throw an error: querychannel(), stopchannel(), isactivesample(), sampleid().
@@ -8286,6 +8286,7 @@ int getsyspropertybyindex(ScriptVariant *var, int index)
case _sv_sample_play_id:
ScriptVariant_ChangeType(var, VT_INTEGER);
var->lVal = sample_play_id;
+ break;
case _sv_effectvol:
ScriptVariant_ChangeType(var, VT_INTEGER);
var->lVal = savedata.effectvol;
@@ -11406,6 +11407,8 @@ HRESULT openbor_querychannel(ScriptVariant **varlist , ScriptVariant **pretvar,
ScriptVariant_ChangeType(*pretvar, VT_INTEGER);
(*pretvar)->lVal = sound_query_channel((LONG)ltemp);
+ return S_OK;
+
query_error:
*pretvar = NULL;
return E_FAIL;
@@ -11421,6 +11424,8 @@ HRESULT openbor_stopchannel(ScriptVariant **varlist , ScriptVariant **pretvar, i
}
sound_stop_sample((LONG)ltemp);
+ return S_OK;
+
sc_error:
return E_FAIL;
}
@@ -11436,6 +11441,8 @@ HRESULT openbor_isactivesample(ScriptVariant **varlist , ScriptVariant **pretvar
ScriptVariant_ChangeType(*pretvar, VT_INTEGER);
(*pretvar)->lVal = sound_is_active((LONG)ltemp);
+ return S_OK;
+
error:
*pretvar = NULL;
return E_FAIL;
@@ -11452,6 +11459,8 @@ HRESULT openbor_sampleid(ScriptVariant **varlist , ScriptVariant **pretvar, int
ScriptVariant_ChangeType(*pretvar, VT_INTEGER);
(*pretvar)->lVal = sound_id((LONG)ltemp);
+ return S_OK;
+
error:
*pretvar = NULL;
return E_FAIL;
