Mercurial > mm7
comparison UI/UiGame.cpp @ 1645:07fe868f0b44
Scavenger Hunt dialogue crash fix.
author | Nomad |
---|---|
date | Tue, 17 Sep 2013 22:10:06 +0200 |
parents | aaefada3e1d8 |
children | d453ed393d6e |
comparison
equal
deleted
inserted
replaced
1644:dbd6f940f26c | 1645:07fe868f0b44 |
---|---|
499 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire | 499 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire |
500 } | 500 } |
501 else if (pButton->msg_param == 24) | 501 else if (pButton->msg_param == 24) |
502 { | 502 { |
503 __debugbreak(); // learn conditions of this event | 503 __debugbreak(); // learn conditions of this event |
504 auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; | 504 if (!pNPC->evt_F) |
505 if (!topic) | |
506 { | 505 { |
507 pButton->pButtonName[0] = 0; | 506 pButton->pButtonName[0] = 0; |
508 pButton->msg_param = 0; | 507 pButton->msg_param = 0; |
509 } | 508 } |
510 else | 509 else |
511 strcpy(pButton->pButtonName, topic); | 510 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_F].pTopic); |
512 } | 511 } |
513 else if (pButton->msg_param == 9) | 512 else if (pButton->msg_param == 9) |
514 strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession)); | 513 strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession)); |
515 else if (pButton->msg_param == 19) | 514 else if (pButton->msg_param == 19) // Scavenger Hunt |
516 { | 515 { |
517 // __debugbreak(); // learn conditions of this event Scavenger Hunt | 516 if (!pNPC->evt_A) |
518 auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; | |
519 if (!topic) | |
520 { | 517 { |
521 pButton->pButtonName[0] = 0; | 518 pButton->pButtonName[0] = 0; |
522 pButton->msg_param = 0; | 519 pButton->msg_param = 0; |
523 } | 520 } |
524 else strcpy(pButton->pButtonName, topic); | 521 else |
525 } | 522 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_A].pTopic); |
526 else if (pButton->msg_param == 20) | 523 } |
527 { | 524 else if (pButton->msg_param == 20) // Scavenger Hunt |
528 //__debugbreak(); // learn conditions of this event instruments | 525 { |
529 auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; | 526 if (!pNPC->evt_B) |
530 if (!topic) | |
531 { | 527 { |
532 pButton->pButtonName[0] = 0; | 528 pButton->pButtonName[0] = 0; |
533 pButton->msg_param = 0; | 529 pButton->msg_param = 0; |
534 } | 530 } |
535 else strcpy(pButton->pButtonName, topic); | 531 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_B].pTopic); |
536 } | 532 } |
537 else if (pButton->msg_param == 21) | 533 else if (pButton->msg_param == 21) |
538 { | 534 { |
539 //__debugbreak(); // learn conditions of this event | 535 //__debugbreak(); // learn conditions of this event |
540 auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; | 536 if (!pNPC->evt_C) |
541 if (!topic) | |
542 { | 537 { |
543 pButton->pButtonName[0] = 0; | 538 pButton->pButtonName[0] = 0; |
544 pButton->msg_param = 0; | 539 pButton->msg_param = 0; |
545 } | 540 } |
546 else strcpy(pButton->pButtonName, topic); | 541 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_C].pTopic); |
547 } | 542 } |
548 else if (pButton->msg_param == 22) | 543 else if (pButton->msg_param == 22) |
549 { | 544 { |
550 //__debugbreak(); // learn conditions of this event | 545 //__debugbreak(); // learn conditions of this event |
551 auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; | 546 if (!pNPC->evt_D) |
552 if (!topic) | |
553 { | 547 { |
554 pButton->pButtonName[0] = 0; | 548 pButton->pButtonName[0] = 0; |
555 pButton->msg_param = 0; | 549 pButton->msg_param = 0; |
556 } | 550 } |
557 else strcpy(pButton->pButtonName, topic); | 551 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_D].pTopic); |
558 } | 552 } |
559 else if (pButton->msg_param == 23) | 553 else if (pButton->msg_param == 23) |
560 { | 554 { |
561 //__debugbreak(); // learn conditions of this event | 555 //__debugbreak(); // learn conditions of this event |
562 auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; | 556 if (!pNPC->evt_E) |
563 if (!topic) | |
564 { | 557 { |
565 pButton->pButtonName[0] = 0; | 558 pButton->pButtonName[0] = 0; |
566 pButton->msg_param = 0; | 559 pButton->msg_param = 0; |
567 } | 560 } |
568 else strcpy(pButton->pButtonName, topic); | 561 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_E].pTopic); |
569 } | 562 } |
570 else if (pButton->msg_param == 13) | 563 else if (pButton->msg_param == 13) |
571 { | 564 { |
572 if (pNPC->Hired()) | 565 if (pNPC->Hired()) |
573 sprintf(pButton->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s | 566 sprintf(pButton->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s |