Skip to content

Commit a6cda44

Browse files
author
Matthew Bate
committed
Fix Server Side tabChat. Clear chatbox on new map.
1 parent a9f2302 commit a6cda44

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

BHD-ServerManager/Forms/Panels/tabChat.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,6 @@ public void functionEvent_UpdateChatMessagesGrid()
158158
var dgv = dataGridView_chatMessages;
159159
var chatLogs = chatInstance!.ChatLog;
160160

161-
// If status is SCORING or LOADING, clear and reload everything
162-
if (theInstance?.instanceStatus == InstanceStatus.SCORING ||
163-
theInstance?.instanceStatus == InstanceStatus.LOADINGMAP)
164-
{
165-
dgv.Rows.Clear();
166-
_autoScrollChat = true; // Reset auto-scroll on reload
167-
return;
168-
}
169-
170161
// Only add new messages
171162
int existingRows = dgv.Rows.Count;
172163
for (int i = existingRows; i < chatLogs.Count; i++)
@@ -211,6 +202,16 @@ public void ChatTickerHook()
211202
// Update chat messages grid
212203
functionEvent_UpdateChatMessagesGrid();
213204
}
205+
206+
// If status is SCORING or LOADING, clear and reload everything
207+
if (theInstance?.instanceStatus == InstanceStatus.SCORING ||
208+
theInstance?.instanceStatus == InstanceStatus.LOADINGMAP)
209+
{
210+
dataGridView_chatMessages.Rows.Clear();
211+
_autoScrollChat = true; // Reset auto-scroll on reload
212+
return;
213+
}
214+
214215
}
215216

216217
/// <summary>

0 commit comments

Comments
 (0)