diff --git a/al/eax/api.h b/al/eax/api.h index 038fdf7591..0b019f114d 100644 --- a/al/eax/api.h +++ b/al/eax/api.h @@ -362,6 +362,7 @@ constexpr auto EAXCONTEXT_MINMACROFXFACTOR = 0.0F; constexpr auto EAXCONTEXT_MAXMACROFXFACTOR = 1.0F; constexpr auto EAXCONTEXT_DEFAULTMACROFXFACTOR = 0.0F; +constexpr auto EAXCONTEXT_DEFAULTLASTERROR = EAX_OK; extern const GUID EAXPROPERTYID_EAX40_FXSlot0; extern const GUID EAXPROPERTYID_EAX50_FXSlot0; diff --git a/alc/context.cpp b/alc/context.cpp index ff22acdf41..b5db03f9ef 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -586,7 +586,7 @@ void ALCcontext::eax_update_speaker_configuration() void ALCcontext::eax_set_last_error_defaults() noexcept { - mEaxLastError = EAX_OK; + mEaxLastError = EAXCONTEXT_DEFAULTLASTERROR; } void ALCcontext::eax_session_set_defaults() noexcept @@ -675,6 +675,7 @@ void ALCcontext::eax_get_misc(const EaxCall& call) break; case EAXCONTEXT_LASTERROR: call.set_value(mEaxLastError); + mEaxLastError = EAX_OK; break; case EAXCONTEXT_SPEAKERCONFIG: call.set_value(mEaxSpeakerConfig); @@ -1045,6 +1046,7 @@ try } catch(...) { + context->eaxSetLastError(); eax_log_exception(__func__); return AL_INVALID_OPERATION; } @@ -1072,6 +1074,7 @@ try } catch(...) { + context->eaxSetLastError(); eax_log_exception(__func__); return AL_INVALID_OPERATION; }