Skip to content

Commit edbec0f

Browse files
committed
Fix incorrect assertion in FRED's Event Editor when deleting a message.
The function can get called with an m_cur_msg of -1 if there are no messages defined by the mission; since this is apparently intended behavior (and causes no problems thanks to the immediately-following if-statement), may as well change this assertion.
1 parent 2c268e4 commit edbec0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/fred2/eventeditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ void event_editor::OnDeleteMsg()
12991299
char buf[256];
13001300

13011301
// handle this case somewhat gracefully
1302-
Assert((m_cur_msg >= 0) && (m_cur_msg < m_num_messages));
1302+
Assertion((m_cur_msg >= -1) && (m_cur_msg < m_num_messages), "Unexpected m_cur_msg value (%d); expected either -1, or between 0-%d. Get a coder!\n", m_cur_msg, m_num_messages - 1);
13031303
if((m_cur_msg < 0) || (m_cur_msg >= m_num_messages)){
13041304
return;
13051305
}

0 commit comments

Comments
 (0)