# HG changeset patch # User Nomad # Date 1379448606 -7200 # Node ID 07fe868f0b4452232aa03083c1d533faa60a0e2c # Parent dbd6f940f26c9cc371dad2a748e53b9d300716d8 Scavenger Hunt dialogue crash fix. diff -r dbd6f940f26c -r 07fe868f0b44 UI/UiGame.cpp --- a/UI/UiGame.cpp Tue Sep 17 21:41:39 2013 +0200 +++ b/UI/UiGame.cpp Tue Sep 17 22:10:06 2013 +0200 @@ -501,71 +501,64 @@ else if (pButton->msg_param == 24) { __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) + if (!pNPC->evt_F) + { + pButton->pButtonName[0] = 0; + pButton->msg_param = 0; + } + else + strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_F].pTopic); + } + else if (pButton->msg_param == 9) + strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession)); + else if (pButton->msg_param == 19) // Scavenger Hunt + { + if (!pNPC->evt_A) { pButton->pButtonName[0] = 0; pButton->msg_param = 0; } else - strcpy(pButton->pButtonName, topic); + strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_A].pTopic); } - else if (pButton->msg_param == 9) - strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession)); - else if (pButton->msg_param == 19) + else if (pButton->msg_param == 20) // Scavenger Hunt { - // __debugbreak(); // learn conditions of this event Scavenger Hunt - auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) + if (!pNPC->evt_B) { pButton->pButtonName[0] = 0; pButton->msg_param = 0; } - else strcpy(pButton->pButtonName, topic); - } - else if (pButton->msg_param == 20) - { - //__debugbreak(); // learn conditions of this event instruments - auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) - { - pButton->pButtonName[0] = 0; - pButton->msg_param = 0; - } - else strcpy(pButton->pButtonName, topic); + else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_B].pTopic); } else if (pButton->msg_param == 21) { //__debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) + if (!pNPC->evt_C) { pButton->pButtonName[0] = 0; pButton->msg_param = 0; } - else strcpy(pButton->pButtonName, topic); + else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_C].pTopic); } else if (pButton->msg_param == 22) { //__debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) + if (!pNPC->evt_D) { pButton->pButtonName[0] = 0; pButton->msg_param = 0; } - else strcpy(pButton->pButtonName, topic); + else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_D].pTopic); } else if (pButton->msg_param == 23) { //__debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; - if (!topic) + if (!pNPC->evt_E) { pButton->pButtonName[0] = 0; pButton->msg_param = 0; } - else strcpy(pButton->pButtonName, topic); + else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_E].pTopic); } else if (pButton->msg_param == 13) {