From 304ab8d8901efc9ecb38fb1d61b2902753896dfc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 15 Dec 2020 21:32:01 -0800 Subject: Avoid a generic event struct --- alc/alu.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'alc') 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(msglen) >= sizeof(evt.u.user.msg)) - evt.u.user.msg[sizeof(evt.u.user.msg)-1] = 0; + if(msglen < 0 || static_cast(msglen) >= sizeof(evt.u.disconnect.msg)) + evt.u.disconnect.msg[sizeof(evt.u.disconnect.msg)-1] = 0; IncrementRef(MixCount); for(ALCcontext *ctx : *mContexts.load()) -- cgit v1.2.3