The crash is caused by a NULL pointer. The chat log is initialized in the
run_chat function. Therefore, if you haven't chat with an NPC the chat_log won't
be initialized and chat_log.text will be NULL. The function chat_add_response
appends text to chat_log.text by calling autostr_append which doesn't check for
NULL pointers.
Moreover, cli_says shouldn't be used in events at all. The only place from which
cli_says should be called are dialogs. Arthur's patch is correct and it fixes
the crash. |