From 19896857e23001779cf525c271a460aac8307ff6 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:33:00 +0100 Subject: [PATCH] RTech: disable assertion for log channels in FS_CloseAsyncFile FS_OpenAsyncFile is inline in StreamDB_Init, and in our implementation, FS_OpenAsyncFile is the only place channel id's get mapped to file slots, so it will be null for stbsp's. Commented assert out as there isn't anything we could do about this besides rebuilding StreamDB_Init which is a large task. --- src/rtech/async/asyncio.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rtech/async/asyncio.cpp b/src/rtech/async/asyncio.cpp index 3a0d0afc..6047505a 100644 --- a/src/rtech/async/asyncio.cpp +++ b/src/rtech/async/asyncio.cpp @@ -82,7 +82,10 @@ void FS_CloseAsyncFile(const int fileHandle) if (selectedLogChannel && (selectedLogChannel == -1 || s_fileHandleLogChannelIDs[slotNum] == selectedLogChannel)) Msg(eDLL_T::RTECH, "%s: Closed file from slot #%d\n", __FUNCTION__, slotNum); - assert(s_fileHandleLogChannelIDs[slotNum] != 0); + // TODO: StreamDB_Init has an inline version of FS_OpenAsyncFile, therefore + // anything loaded there will never have the channel id's set. In order to + // fix this, StreamDB_Init has to be rebuilt. + //assert(s_fileHandleLogChannelIDs[slotNum] != 0); s_fileHandleLogChannelIDs[slotNum] = 0; } }