diff options
author | Chris Robinson <[email protected]> | 2020-12-15 21:32:01 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-15 21:32:01 -0800 |
commit | 304ab8d8901efc9ecb38fb1d61b2902753896dfc (patch) | |
tree | 78f9e2150e5059c5dde06bf9ea05bca13bbd0c23 /alc | |
parent | a08f68f213a79544a78ee0459d8c9065c2c9894d (diff) |
Avoid a generic event struct
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alu.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index f3c21c06..007a328b 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1974,17 +1974,14 @@ void ALCdevice::handleDisconnect(const char *msg, ...) return; AsyncEvent evt{EventType_Disconnected}; - evt.u.user.type = AL_EVENT_TYPE_DISCONNECTED_SOFT; - evt.u.user.id = 0; - evt.u.user.param = 0; va_list args; va_start(args, msg); - int msglen{vsnprintf(evt.u.user.msg, sizeof(evt.u.user.msg), msg, args)}; + int msglen{vsnprintf(evt.u.disconnect.msg, sizeof(evt.u.disconnect.msg), msg, args)}; va_end(args); - if(msglen < 0 || static_cast<size_t>(msglen) >= sizeof(evt.u.user.msg)) - evt.u.user.msg[sizeof(evt.u.user.msg)-1] = 0; + if(msglen < 0 || static_cast<size_t>(msglen) >= sizeof(evt.u.disconnect.msg)) + evt.u.disconnect.msg[sizeof(evt.u.disconnect.msg)-1] = 0; IncrementRef(MixCount); for(ALCcontext *ctx : *mContexts.load()) |