comparison UIHouses.cpp @ 727:da130dd3092a

Big time Travel ouverhaul
author Nomad
date Fri, 22 Mar 2013 00:02:31 +0200
parents 26dfde53decd
children 9f596a163257
comparison
equal deleted inserted replaced
710:735dab8d3c9a 727:da130dd3092a
20 #include "Monsters.h" 20 #include "Monsters.h"
21 #include "Viewport.h" 21 #include "Viewport.h"
22 #include "Keyboard.h" 22 #include "Keyboard.h"
23 #include "NPC.h" 23 #include "NPC.h"
24 24
25 #include "MM7.h"
25 #include "mm7_data.h" 26 #include "mm7_data.h"
26 27
27 28
28 int uHouse_ExitPic; // weak 29 int uHouse_ExitPic; // weak
29 30
454 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType; 455 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
455 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail 456 if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail
456 { 457 {
457 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID; 458 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
458 uHouseID = HOUSE_JAIL; 459 uHouseID = HOUSE_JAIL;
459 pParty->uTimePlayed = pParty->uTimePlayed+ 0x7620000; 460 pParty->uTimePlayed = pParty->uTimePlayed + 0x7620000;
460 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE].uAnimationID].uBuildingType; 461 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE_EMERALD_ISLE].uAnimationID].uBuildingType;
461 ++pParty->uNumPrisonTerms; 462 ++pParty->uNumPrisonTerms;
462 pParty->uFine = 0; 463 pParty->uFine = 0;
463 for (uint i = 0; i < 4; ++i) 464 for (uint i = 0; i < 4; ++i)
464 { 465 {
465 pParty->pPlayers[i].uTimeToRecovery = 0; 466 pParty->pPlayers[i].uTimeToRecovery = 0;
488 if ( uNumDialogueNPCPortraits == 1 ) 489 if ( uNumDialogueNPCPortraits == 1 )
489 pDialogueNPCCount = 1; 490 pDialogueNPCCount = 1;
490 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u); 491 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
491 dword_5C35D4 = 1; 492 dword_5C35D4 = 1;
492 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) 493 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
493 { 494 {
494 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) 495 if ( (signed int)uHouseID >= HOUSE_STABLES_HARMONDALE && (signed int)uHouseID <= 73 && !IsTravelAvailable(uHouseID - HOUSE_STABLES_HARMONDALE) )
495 { 496 {
496 return 1; 497 return 1;
497 } 498 }
498 } 499 }
499 else 500 else
500 { //guilds 501 { //guilds
501 v19 = guild_mambership_flags[uHouseID-139]; //guilds flags 502 v19 = guild_mambership_flags[uHouseID-139]; //guilds flags
502 //v20 = uHouseID; 503 //v20 = uHouseID;
503 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) ) 504 //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
545 } 546 }
546 547
547 548
548 549
549 //----- (004B68EA) -------------------------------------------------------- 550 //----- (004B68EA) --------------------------------------------------------
550 bool __fastcall sub_4B68EA(int a1) 551 bool __fastcall IsTravelAvailable(int a1)
551 { 552 {
552 signed int v1; // edi@1 553 //signed int v1; // edi@1
553 int *v2; // esi@1 554 //int *v2; // esi@1
554 int v3; // ecx@2 555 //int v3; // ecx@2
555 556
556 v1 = 0; 557 __debugbreak(); // fill all 25 elements of array_4F09B0 before continue
557 v2 = &dword_4F0E10[a1]; 558 //v1 = 0;
558 while ( 1 ) 559 //v2 = &dword_4F0E10[a1];
560 //while ( 1 )
561 for (uint i = 0; i < 4; ++i)
559 { 562 {
560 v3 = 8 * *((char *)v2 + v1); 563 uint idx = byte_4F0E10[a1][i];
561 if ( *(&byte_4F09B1[pParty->uDaysPlayed % 7] + v3 * 4) ) 564 //v3 = 8 * byte_4F0E10[a1][i];
562 { 565 if (array_4F09B0[idx].pSchedule[pParty->uDaysPlayed % 7])
563 if ( !dword_4F09CC[v3] || (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, LOWORD(dword_4F09CC[v3])) ) 566 {
564 break; 567 if (!array_4F09B0[idx].uQuestBit || _449B57_test_bit(pParty->_quest_bits, array_4F09B0[idx].uQuestBit))
568 return true;
565 } 569 }
566 ++v1; 570 //++v1;
567 if ( v1 >= 4 ) 571 //if ( v1 >= 4 )
568 return 0; 572 // return 0;
569 } 573 }
570 return 1; 574 return false;
575 //return 1;
571 } 576 }
572 577
573 578
574 579
575 //----- (004B7911) -------------------------------------------------------- 580 //----- (004B7911) --------------------------------------------------------