changeset 776:3dc4a9b13c1b

travel struct fixed
author Gloval
date Sun, 24 Mar 2013 00:50:35 +0400
parents 7994986603d5
children 64cef5a0782a
files UIHouses.cpp mm7_data.cpp mm7_data.h
diffstat 3 files changed, 99 insertions(+), 89 deletions(-) [+]
line wrap: on
line diff
--- a/UIHouses.cpp	Sat Mar 23 21:40:30 2013 +0200
+++ b/UIHouses.cpp	Sun Mar 24 00:50:35 2013 +0400
@@ -41,8 +41,7 @@
 {
   unsigned char uMapInfoID;
   unsigned char pSchedule[7];
-  unsigned char uTravelTime;
-  unsigned char field_9[3];
+  unsigned int uTravelTime;
   int field_C;
   int field_10;
   int field_14;
@@ -50,33 +49,44 @@
   unsigned int  uQuestBit;  // quest bit required to set for this travel option to be enabled; otherwise 0
 };
 #pragma pack(pop)
-stru365_travel_info array_4F09B0[25] =
+
+stru365_travel_info array_4F09B0[35] =
 {
-  { 3,  {1, 0, 1, 0, 1, 0, 0}, 2, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  { 4,  {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFF621, 4294960523, 1153, 896, 0},
-  {13,  {1, 0, 1, 0, 1, 0, 0}, 2, {0, 0, 0}, 0x127A, 4294956716, 320, 1024, 0},
-  { 2,  {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFE9C4, 11137, 1, 1024, 0},
-  { 5,  {1, 0, 0, 1, 0, 0, 0}, 3, {0, 0, 0}, 0x1C3B, 4294951289, 2625, 640, 0},
-  { 6,  {0, 0, 1, 0, 0, 1, 0}, 3, {0, 0, 0}, 0x22DB, 17191, 1, 512, 0},
-  {14,  {1, 0, 1, 0, 1, 0, 0}, 3, {0, 0, 0}, 0x42A3, 12331, 512, 1152, 0},
-  { 5,  {0, 1, 0, 0, 1, 0, 1}, 2, {0, 0, 0}, 0x1C3B, 4294951289, 2625, 640, 0},
-  { 2,  {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFE9C4, 11137, 1, 1024, 0},
-  { 3,  {1, 0, 1, 0, 1, 0, 0}, 3, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  { 4,  {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFF621, 4294960523, 1153, 896, 0},
-  { 3,  {1, 0, 1, 0, 1, 0, 1}, 3, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  { 2,  {0, 1, 0, 0, 0, 1, 0}, 5, {0, 0, 0}, 0xFFFFE9C4, 11137, 1, 1024, 0},
-  { 3,  {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFB980, 4636, 833, 1536, 0},
-  { 4,  {0, 1, 0, 1, 0, 1, 0}, 3, {0, 0, 0}, 0xFFFFF621, 4294960523, 1153, 896, 0},
-  { 5,  {0, 0, 1, 0, 0, 0, 1}, 5, {0, 0, 0}, 0x1C3B, 4294951289, 2625, 640, 0},
-  {13,  {0, 1, 0, 1, 0, 1, 0}, 2, {0, 0, 0}, 0xFFFFF779, 4294960355, 97, 0, 0},
-  {14,  {1, 0, 0, 0, 1, 0, 0}, 4, {0, 0, 0}, 0x1EE9, 9476, 193, 0, 0},
-  { 9,  {0, 0, 0, 0, 0, 0, 1}, 7, {0, 0, 0}, 0x3D00, 6390, 193, 1536, 0x40},
-  { 6,  {0, 0, 1, 0, 0, 0, 0}, 6, {0, 0, 0}, 0x4AE3, 4294947574, 193, 1024, 0},
-  {14,  {0, 1, 0, 1, 0, 1, 0}, 3, {0, 0, 0}, 0x1EE9, 9476, 193, 0, 0},
-  { 6,  {1, 0, 1, 0, 0, 0, 0}, 6, {0, 0, 0}, 0x4AE3, 4294947574, 193, 1024, 0},
-  {13,  {1, 0, 1, 0, 1, 0, 0}, 4, {0, 0, 0}, 0xFFFFF779, 4294960355, 97, 0, 0},
-  { 4,  {0, 0, 0, 0, 0, 1, 0}, 6, {0, 0, 0}, 0xFFFFFD3B, 4294953209, 193, 1024, 0},
-  { 3,  {0, 0, 0, 0, 0, 0, 1}, 6, {0, 0, 0}, 0xFFFFD719, 13497, 193, 1536, 0},
+   { 3, { 1, 0, 1, 0, 1, 0, 0}, 2, -18048,   4636,  833, 1536, 0},
+   { 4, { 0, 1, 0, 1, 0, 1, 0}, 2,  -2527,  -6773, 1153,  896, 0},
+   {13, { 1, 0, 1, 0, 1, 0, 0}, 2,   4730, -10580,  320, 1024, 0},
+   { 2, { 0, 1, 0, 1, 0, 1, 0}, 2,  -5692,  11137,    1, 1024, 0},
+   { 5, { 1, 0, 0, 1, 0, 0, 0}, 3,   7227, -16007, 2625,  640, 0},
+   { 6, { 0, 0, 1, 0, 0, 1, 0}, 3,   8923,  17191,    1,  512, 0},
+   {14, { 1, 0, 1, 0, 1, 0, 0}, 3,  17059,  12331,  512, 1152, 0},
+   { 5, { 0, 1, 0, 0, 1, 0, 1}, 2,   7227,  16007, 2625,  640, 0},
+   { 2, { 0, 1, 0, 1, 0, 1, 0}, 2,  -5692,  11137,    1, 1024, 0},
+   { 3, { 1, 0, 1, 0, 1, 0, 0}, 3, -18048,   4636,  833, 1536, 0},
+   { 4, { 0, 1, 0, 1, 0, 1, 0}, 2,  -2527,  -6773, 1153,  896, 0},
+   { 3, { 1, 0, 1, 0, 1, 0, 1}, 3, -18048,   4636,  833, 1536, 0},
+   { 2, { 0, 1, 0, 0, 0, 1, 0}, 5,  -5692,  11137,    1, 1024, 0},
+   { 3, { 0, 1, 0, 1, 0, 1, 0}, 2, -18048,   4636,  833, 1536, 0},
+   { 4, { 0, 1, 0, 1, 0, 1, 0}, 3,  -2527,  -6773, 1153,  896, 0},
+   { 5, { 0, 0, 1, 0, 0, 0, 1}, 5,   7227, -16007, 2625,  640, 0},
+   {13, { 0, 1, 0, 1, 0, 1, 0}, 2,  -2183,  -6941,   97,    0, 0},
+   {14, { 1, 0, 0, 0, 1, 0, 0}, 4,   7913,   9476,  193,    0, 0},
+   { 9, { 0, 0, 0, 0, 0, 0, 1}, 7,  15616,   6390,  193, 1536, 0x40},
+   { 6, { 0, 0, 1, 0, 0, 0, 0}, 6,  19171, -19722,  193, 1024, 0},
+   {14, { 0, 1, 0, 1, 0, 1, 0}, 3,   7913,   9476,  193,    0, 0},
+   { 6, { 1, 0, 1, 0, 0, 0, 0}, 6,  19171, -19722,  193, 1024, 0},
+   {13, { 1, 0, 1, 0, 1, 0, 0}, 4,  -2183,  -6941,   97,    0, 0},
+   { 4, { 0, 0, 0, 0, 0, 1, 0}, 6,   -709, -14087,  193, 1024, 0},
+   { 3, { 0, 0, 0, 0, 0, 0, 1}, 6, -10471,  13497,  193, 1536, 0},
+   { 9, { 0, 1, 0, 1, 0, 0, 0}, 1,  15616,   6390,  193, 1536, 0x40},
+   { 6, { 0, 1, 0, 1, 0, 0, 0}, 1,  19171, -19722,  193, 1024, 0},
+   { 3, { 0, 1, 0, 1, 0, 1, 0}, 2, -10471,  13497,  193, 1536, 0},
+   { 6, { 1, 0, 1, 0, 0, 0, 0}, 4,  19171, -19722,  193, 1024, 0},
+   { 9, { 0, 0, 0, 0, 0, 0, 1}, 5,  15616,   6390,  193, 1536, 0x40},
+   {14, { 0, 0, 0, 0, 1, 0, 0}, 5,   7913,   9476,  193,    0, 0},
+   { 3, { 0, 1, 0, 0, 0, 1, 0}, 4, -10471,  13497,  193, 1536, 0},
+   { 4, { 1, 0, 1, 0, 1, 0, 0}, 3,   -709, -14087,  193, 1024, 0},
+   {13, { 0, 0, 0, 1, 0, 0, 0}, 5,  -2183,  -6941,   97,    0, 0},
+   {76, { 0, 0, 0, 0, 0, 0, 1}, 4,   3844,   2906,  193,  512, 0}
 };
 
 const stru159 pAnimatedRooms[196] = //0x4E5F70
@@ -279,7 +289,63 @@
         {"Player Castle Bad",           0x24, 0, 25, 0, 0}
     };
 
+unsigned char byte_4F0CD0[30][4] =
+    {
+        {  9,   0,   1,   0},  // BildingType_WeaponShop
+        {  1,   0,   0,   0},  // BildingType_ArmorShop
+        {  1,   0,   0,   0},  // BildingType_MagicShop
+        {  0,  61,   0,   0},  // BildingType_AlchemistShop
+        {246,  24,   0,   0},  // BildingType_FireGuild
+        {193,   0,   0,   0},  // BildingType_AirGuild
+        {  0,   6,   0,   0},  // BildingType_WaterGuild
+        { 64,   0,   0,   0},  // BildingType_EarthGuild
+        {  6,   0,   1,   0},  // BildingType_SpiritGuild
+        {  1,   0,   0,   0},  // BildingType_MindGuild
+        {  1,   0,   0,   0},  // BildingType_BodyGuild
+        {227,  74,   0,   0},  // BildingType_LightGuild
+        {246, 178, 255, 255},  // BildingType_DarkGuild
+        {193,   0,   0,   0},  // BildingType_14
+        {  0,   4,   0,   0},  // BildingType_15
+        {  0,   0,   0,   0},  // BildingType_16
+        {  3,   0,   1,   0},  // BildingType_TownHall
+        {  1,   0,   1,   0},  // BildingType_18
+        {  2,   0,   0,   0},  // BildingType_19
+        { 25, 215, 255, 255},  // BildingType_Throne_Room
+        {185,  52,   0,   0},  // BildingType_Tavern
+        {193,   0,   0,   0},  // BildingType_Bank
+        {  0,   6,   0,   0},  // BildingType_Temple
+        {  0,   0,   0,   0},  // BuildingType_24
+        {  6,   1,   0,   1},  // BildingType_Unic
+        {  0,   0,   0,   0},  // BildingType_1A
+        {  4,   0,   0,   0},  // BildingType_Stables
+        {227,  74,   0,   0},  // BildingType_Boats
+        {246, 178, 255, 255},  // BildingType_House
+        {193,   0,   0,   0}   // BildingType_Training
+    };
 
+unsigned char byte_4F0E10[20][4] =
+    {
+        {  0,   1,   1,  34},
+        {  2,   3,   4,   5},
+        {  6,   7,   8,   8},
+        {  9,  10,  10,  10},
+        { 11,  11,  12,  12},
+        { 13,  13,  13,  13},
+        { 14,  14,  15,  15},
+        {255, 255, 255, 255},
+        {255, 255, 255, 255},
+        {255, 255, 255, 255},
+        { 16,  17,  18,  19},
+        { 18,  20,  21,  21},
+        { 22,  23,  24,  25},
+        { 22,  22,  23,  23},
+        {255, 255, 255, 255},
+        { 27,  28,  29,  30},
+        { 31,  32,  33,  33},
+        { 24,  24,  24,  24},
+        {255, 255, 255, 255},
+        {255, 255, 255, 255}
+    };
 
 
 //----- (0044606A) --------------------------------------------------------
@@ -703,7 +769,7 @@
 	  {
 		  v8 = window_SpeakInHouse;
 		  if ((in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats) &&
-			  array_4F09B0[byte_4F0CD0[(unsigned int)window_SpeakInHouse->ptr_1C - 1][uMessageParam - 1]].pSchedule[pParty->uDaysPlayed % 7]
+			  array_4F09B0[byte_4F0CD0[window_SpeakInHouse->par1C - 1][uMessageParam - 1]].pSchedule[pParty->uDaysPlayed % 7]
 			|| in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
 		  {
 		//LABEL_9:
@@ -1906,7 +1972,7 @@
       }
       Party::TakeGold(s1);
       //v47[1] = (const char *)7;
-      v5 = &array_4F09B0[byte_4F0CD0[(unsigned int)window_SpeakInHouse->ptr_1C - 1][dialog_menu_id - 1]];
+      v5 = &array_4F09B0[byte_4F0CD0[window_SpeakInHouse->par1C - 1][dialog_menu_id - 1]];
       if ( v5->pSchedule[pParty->uDaysPlayed % 7] )
       {
         if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename) )
@@ -2009,7 +2075,7 @@
   //int *v2; // esi@1
   //int v3; // ecx@2
 
-  __debugbreak(); // fill all 25 elements of array_4F09B0 before continue
+  //__debugbreak(); // fill all 25 elements of array_4F09B0 before continue
   //v1 = 0;
   //v2 = &dword_4F0E10[a1];
   //while ( 1 )
--- a/mm7_data.cpp	Sat Mar 23 21:40:30 2013 +0200
+++ b/mm7_data.cpp	Sun Mar 24 00:50:35 2013 +0400
@@ -1498,63 +1498,7 @@
 
 
 
-unsigned char byte_4F0CD0[30][4] =
-{
-  {  9,   0,   1,   0},  // BildingType_WeaponShop
-  {  1,   0,   0,   0},  // BildingType_ArmorShop
-  {  1,   0,   0,   0},  // BildingType_MagicShop
-  {  0,  61,   0,   0},  // BildingType_AlchemistShop
-  {246,  24,   0,   0},  // BildingType_FireGuild
-  {193,   0,   0,   0},  // BildingType_AirGuild
-  {  0,   6,   0,   0},  // BildingType_WaterGuild
-  { 64,   0,   0,   0},  // BildingType_EarthGuild
-  {  6,   0,   1,   0},  // BildingType_SpiritGuild
-  {  1,   0,   0,   0},  // BildingType_MindGuild
-  {  1,   0,   0,   0},  // BildingType_BodyGuild
-  {227,  74,   0,   0},  // BildingType_LightGuild
-  {246, 178, 255, 255},  // BildingType_DarkGuild
-  {193,   0,   0,   0},  // BildingType_14
-  {  0,   4,   0,   0},  // BildingType_15
-  {  0,   0,   0,   0},  // BildingType_16
-  {  3,   0,   1,   0},  // BildingType_TownHall
-  {  1,   0,   1,   0},  // BildingType_18
-  {  2,   0,   0,   0},  // BildingType_19
-  { 25, 215, 255, 255},  // BildingType_Throne_Room
-  {185,  52,   0,   0},  // BildingType_Tavern
-  {193,   0,   0,   0},  // BildingType_Bank
-  {  0,   6,   0,   0},  // BildingType_Temple
-  {  0,   0,   0,   0},  // BuildingType_24
-  {  6,   1,   0,   1},  // BildingType_Unic
-  {  0,   0,   0,   0},  // BildingType_1A
-  {  4,   0,   0,   0},  // BildingType_Stables
-  {227,  74,   0,   0},  // BildingType_Boats
-  {246, 178, 255, 255},  // BildingType_House
-  {193,   0,   0,   0}   // BildingType_Training
-};
 
-unsigned char byte_4F0E10[20][4] =
-{
-  {  0,   1,   1,  34},
-  {  2,   3,   4,   5},
-  {  6,   7,   8,   8},
-  {  9,  10,  10,  10},
-  { 11,  11,  12,  12},
-  { 13,  13,  13,  13},
-  { 14,  14,  15,  15},
-  {255, 255, 255, 255},
-  {255, 255, 255, 255},
-  {255, 255, 255, 255},
-  { 16,  17,  18,  19},
-  { 18,  20,  21,  21},
-  { 22,  23,  24,  25},
-  { 22,  22,  23,  23},
-  {255, 255, 255, 255},
-  { 27,  28,  29,  30},
-  { 31,  32,  33,  33},
-  { 24,  24,  24,  24},
-  {255, 255, 255, 255},
-  {255, 255, 255, 255}
-};
 Vec2_int_ pMonsterArenaPlacements[20];
 __int16 word_4F0F30[32] ={ 4, 7, 10, 11,                                              
 						   4, 7, 10, 11,
--- a/mm7_data.h	Sat Mar 23 21:40:30 2013 +0200
+++ b/mm7_data.h	Sun Mar 24 00:50:35 2013 +0400
@@ -1016,10 +1016,10 @@
 //extern char byte_4F09B8[]; // weak
 //extern int dword_4F09CC[192];
 //extern char byte_4F0CCF[]; // weak
-extern unsigned char byte_4F0CD0[30][4];
+//extern unsigned char byte_4F0CD0[30][4];
 //extern char _4F0D38_TravelInfo[]; // negindex inside byte_4F0CD0; indexing furthers structs
 //extern int dword_4F0E10[32];
-extern unsigned char byte_4F0E10[20][4];
+//extern unsigned char byte_4F0E10[20][4];
 extern Vec2_int_ pMonsterArenaPlacements[20];
 extern __int16 word_4F0F30[32]; // weak
 extern char aS03d[]; // idb