annotate MapInfo.cpp @ 2426:22ac062b40f7

Слияние
author Ritor1
date Wed, 23 Jul 2014 16:06:33 +0600
parents f4af3b203f65
children 0f17a30149ec
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
4
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
5 #include "MapInfo.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
6 #include "LOD.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
7 #include "ErrorHandling.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
8 #include "mm7_data.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
9 #include "texts.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
10 #include "ObjectList.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
11 #include "SpriteObject.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
12 #include "Indoor.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
13 #include "mm7_unsorted_subs.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
14
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
15
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
16 //----- (00453F62) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
17 void MapStats::Initialize()
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
18 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
19 char work_str[32]; // [sp+Ch] [bp-34h]@3
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
20 int work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
21 int work_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
22 int i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
23 char* test_string;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
24 unsigned char c;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
25 bool break_loop;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
26 unsigned int temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
27 char* tmp_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
28 int decode_step;
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
29 // int item_counter;
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
30
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2334
diff changeset
31 free(pMapStatsTXT_Raw);
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
32 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
33 strtok(pMapStatsTXT_Raw, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
34 strtok(NULL, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
35 strtok(NULL, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
36
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
37 for (i=1; i<77; ++i)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
38 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
39 test_string = strtok(NULL, "\r") + 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
40 break_loop = false;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
41 decode_step=0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
42 do
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
43 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
44 c = *(unsigned char*)test_string;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
45 temp_str_len = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
46 while((c!='\t')&&(c>0))
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
47 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
48 ++temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
49 c=test_string[temp_str_len];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
50 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
51 tmp_pos=test_string+temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
52 if (*tmp_pos == 0)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
53 break_loop = true;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
54 *tmp_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
55 if (temp_str_len)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
56 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
57 switch (decode_step)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
58 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
59 case 1:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
60 pInfos[i].pName = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
61 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
62 case 2:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
63 pInfos[i].pFilename = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
64 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
65 case 3:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
66 pInfos[i].uNumResets = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
67 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
68 case 4:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
69 pInfos[i].uFirstVisitedAt = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
70 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
71 case 5:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
72 pInfos[i]._per = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
73 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
74 case 6:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
75 pInfos[i].uRespawnIntervalDays = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
76 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
77 case 7:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
78 pInfos[i]._alert_days = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
79 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
80 case 8:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
81 pInfos[i]._steal_perm = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
82 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
83 case 9:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
84 pInfos[i].LockX5 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
85 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
86 case 10:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
87 pInfos[i].Trap_D20 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
88 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
89 case 11:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
90 pInfos[i].Treasure_prob = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
91 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
92 case 12:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
93 pInfos[i].Encounter_percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
94 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
95 case 13:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
96 pInfos[i].EncM1percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
97 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
98 case 14:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
99 pInfos[i].EncM2percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
100 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
101 case 15:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
102 pInfos[i].EncM3percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
103 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
104 case 16:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
105 pInfos[i].pEncounterMonster1Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
106 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
107 case 18:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
108 pInfos[i].Dif_M1 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
109 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
110 case 19:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
111 pInfos[i].uEncounterMonster1AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
112 pInfos[i].uEncounterMonster1AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
113 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
114 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
115 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
116 if (work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
117 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
118 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
119 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
120 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
121 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
122 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
123 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
124 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
125 pInfos[i].uEncounterMonster1AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
126 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
127 pInfos[i].uEncounterMonster1AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
128 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
129 pInfos[i].uEncounterMonster1AtMost = pInfos[i].uEncounterMonster1AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
130 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
131 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
132 case 20:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
133 pInfos[i].pEncounterMonster2Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
134 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
135 case 22:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
136 pInfos[i].Dif_M2 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
137 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
138 case 23:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
139 pInfos[i].uEncounterMonster2AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
140 pInfos[i].uEncounterMonster2AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
141 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
142 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
143 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
144 if (work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
145 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
146 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
147 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
148 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
149 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
150 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
151 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
152 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
153 pInfos[i].uEncounterMonster2AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
154 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
155 pInfos[i].uEncounterMonster2AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
156 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
157 pInfos[i].uEncounterMonster2AtMost = pInfos[i].uEncounterMonster2AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
158 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
159 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
160 case 24:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
161 pInfos[i].pEncounterMonster3Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
162 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
163 case 26:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
164 pInfos[i].Dif_M3 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
165 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
166 case 27:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
167 pInfos[i].uEncounterMonster3AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
168 pInfos[i].uEncounterMonster3AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
169 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
170 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
171 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
172 if (work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
173 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
174 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
175 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
176 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
177 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
178 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
179 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
180 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
181 pInfos[i].uEncounterMonster3AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
182 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
183 pInfos[i].uEncounterMonster3AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
184 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
185 pInfos[i].uEncounterMonster3AtMost = pInfos[i].uEncounterMonster3AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
186 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
187 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
188 case 28:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
189 pInfos[i].uRedbookTrackID = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
190 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
191 case 29:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
192 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
193 if ( !strcmp(test_string, "CAVE") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
194 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
195 pInfos[i].uEAXEnv = 8;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
196 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
197 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
198 if ( !strcmp(test_string, "STONEROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
199 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
200 pInfos[i].uEAXEnv = 5;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
201 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
202 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
203 if ( !strcmp(test_string, "MOUNTAINS") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
204 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
205 pInfos[i].uEAXEnv = 17;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
206 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
207 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
208 if ( !strcmp(test_string, "PLAIN") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
209 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
210 pInfos[i].uEAXEnv = 19;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
211 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
212 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
213 if ( !strcmp(test_string, "FOREST") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
214 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
215 pInfos[i].uEAXEnv = 15;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
216 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
217 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
218 if ( !strcmp(test_string, "CITY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
219 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
220 pInfos[i].uEAXEnv = 16;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
221 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
222 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
223 if ( !strcmp(test_string, "UNDERWATER") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
224 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
225 pInfos[i].uEAXEnv = 22;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
226 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
227 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
228 if ( !strcmp(test_string, "ARENA") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
229 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
230 pInfos[i].uEAXEnv = 9;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
231 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
232 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
233 if ( !strcmp(test_string, "GENERIC") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
234 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
235 pInfos[i].uEAXEnv = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
236 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
237 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
238 if ( !strcmp(test_string, "PADDEDCELL") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
239 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
240 pInfos[i].uEAXEnv = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
241 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
242 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
243 if ( !strcmp(test_string, "ROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
244 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
245 pInfos[i].uEAXEnv = 2;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
246 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
247 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
248 if ( !strcmp(test_string, "BATHROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
249 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
250 pInfos[i].uEAXEnv = 3;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
251 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
252 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
253 if ( !strcmp(test_string, "LIVINGROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
254 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
255 pInfos[i].uEAXEnv = 4;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
256 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
257 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
258 if ( !strcmp(test_string, "AUDITORIUM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
259 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
260 pInfos[i].uEAXEnv = 6;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
261 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
262 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
263 if ( !strcmp(test_string, "CONCERTHALL") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
264 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
265 pInfos[i].uEAXEnv = 7;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
266 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
267 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
268 if ( !strcmp(test_string, "HANGAR") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
269 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
270 pInfos[i].uEAXEnv = 10;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
271 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
272 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
273 if ( !strcmp(test_string, "CARPETEDHALLWAY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
274 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
275 pInfos[i].uEAXEnv = 11;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
276 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
277 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
278 if ( !strcmp(test_string, "HALLWAY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
279 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
280 pInfos[i].uEAXEnv = 12;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
281 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
282 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
283 if ( !strcmp(test_string, "STONECORRIDOR") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
284 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
285 pInfos[i].uEAXEnv = 13;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
286 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
287 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
288 if ( !strcmp(test_string, "ALLEY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
289 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
290 pInfos[i].uEAXEnv = 14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
291 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
292 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
293 if ( !strcmp(test_string, "QUARRY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
294 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
295 pInfos[i].uEAXEnv = 18;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
296 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
297 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
298 if ( !strcmp(test_string, "PARKINGLOT") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
299 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
300 pInfos[i].uEAXEnv = 20;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
301 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
302 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
303 if ( !strcmp(test_string, "SEWERPIPE") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
304 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
305 pInfos[i].uEAXEnv = 21;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
306 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
307 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
308 if ( !strcmp(test_string, "DRUGGED") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
309 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
310 pInfos[i].uEAXEnv = 23;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
311 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
312 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
313 if ( !strcmp(test_string, "DIZZY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
314 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
315 pInfos[i].uEAXEnv = 24;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
316 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
317 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
318 if ( !strcmp(test_string, "PSYCHOTIC") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
319 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
320 pInfos[i].uEAXEnv = 25;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
321 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
322 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
323 pInfos[i].uEAXEnv = 26;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
324
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
325 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
326 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
327 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
328 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
329 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
330 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
331 break_loop = true;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
332 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
333 ++decode_step;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
334 test_string=tmp_pos+1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
335 } while ((decode_step<31)&&!break_loop);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
336 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
337
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
338 uNumMaps = 77;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
339 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
340 // 453F62: using guessed type char Str[32];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
341
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
342 //----- (00410D99) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
343 int MapStats::sub_410D99_get_map_index(int a1)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
344 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
345 for (int i = 1; i <= pMapStats->uNumMaps; i++)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
346 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
347 if (_stricmp(pMapStats->pInfos[i].pFilename, pGames_LOD->pSubIndices[a1].pFilename) )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
348 return i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
349 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
350 Error("Map not found");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
351 return -1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
352 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
353
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
354 //----- (004547A3) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
355 MAP_TYPE MapStats::GetMapInfo(const char *Str2)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
356 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
357 Assert(uNumMaps >= 2);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
358
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
359 for (uint i = 1; i < uNumMaps; ++i)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
360 if (!_stricmp(pInfos[i].pFilename, Str2))
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
361 return (MAP_TYPE)i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
362
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
363 Error("Map not found!");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
364 return (MAP_TYPE)-1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
365 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
366
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
367
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
368 //----- (0044FFD8) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
369 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
370 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
371 //MapInfo *v2; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
372 //SpawnPointMM7 *v3; // esi@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
373 //int v4; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
374 int v5; // edx@1
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
375 // int v6; // eax@1
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
376 int v7; // ecx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
377 int v8; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
378 int v9; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
379 signed int v10; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
380 signed int result; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
381 signed __int64 v12; // qtt@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
382 int v13; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
383 int v14; // edx@10
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
384 signed int v15; // ebx@20
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
385 unsigned __int16 v16; // dx@20
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
386 // ObjectDesc *v17; // ecx@21
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
387 unsigned __int16 v18; // ax@24
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
388 int v19; // ST0C_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
389 int v20; // ST08_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
390 int v21; // ST04_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
391 int v22; // eax@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
392 signed int v23; // ebx@29
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
393 unsigned __int16 v24; // dx@29
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
394 // ObjectDesc *v25; // ecx@30
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
395 unsigned __int16 v26; // ax@33
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
396 //int v27; // ecx@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
397 //int v28; // eax@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
398 //int v29; // esi@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
399 //__int16 v30; // ax@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
400 SpriteObject a1a; // [sp+Ch] [bp-7Ch]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
401 //int v32; // [sp+7Ch] [bp-Ch]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
402 //int v33; // [sp+80h] [bp-8h]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
403 int v34; // [sp+84h] [bp-4h]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
404
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
405 //auto a1 = this;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
406 //v2 = a1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
407 //v3 = a2;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
408 //v4 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
409 v34 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
410 v5 = rand() % 100;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
411 // v6 = 2 * (v2->Treasure_prob + 7 * v3->uIndex) - 14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
412 v7 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
413 v8 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob + 1];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
414 //v32 = v5;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
415 //v33 = v7;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
416 v9 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
417 v10 = v8 - v7 + 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
418 v12 = v9;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
419 result = v9 / v10;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
420 v13 = v7 + (unsigned __int64)(v12 % v10);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
421 if ( v13 < 7 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
422 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
423 if ( v5 < 20 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
424 return result;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
425 if ( v5 >= 60 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
426 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
427 v19 = a2->vPosition.z;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
428 v20 = a2->vPosition.y;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
429 v21 = a2->vPosition.x;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
430 v22 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
431 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
432 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
433 if ( a2->uIndex == 1 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
434 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
435 v14 = rand() % 51 + 50;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
436 a1a.stru_24.uItemID = 197;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
437 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
438 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
439 else if ( a2->uIndex == 2 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
440 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
441 v14 = rand() % 101 + 100;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
442 a1a.stru_24.uItemID = 197;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
443 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
444 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
445 else if ( a2->uIndex == 3 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
446 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
447 v14 = rand() % 301 + 200;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
448 a1a.stru_24.uItemID = 198;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
449 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
450 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
451 else if ( a2->uIndex == 4 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
452 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
453 v14 = rand() % 501 + 500;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
454 a1a.stru_24.uItemID = 198;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
455 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
456 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
457 else if ( a2->uIndex == 5 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
458 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
459 v14 = rand() % 1001 + 1000;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
460 a1a.stru_24.uItemID = 199;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
461 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
462 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
463 else if ( a2->uIndex == 6 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
464 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
465 v14 = rand() % 3001 + 2000;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
466 a1a.stru_24.uItemID = 199;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
467 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
468 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
469 v15 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
470 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
471 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
472 v18 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
473 for( int i = 0; i < pObjectList->uNumObjects; i++ )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
474 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
475 if ( pObjectList->pObjects[i].uObjectID == v16 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
476 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
477 v18 = i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
478 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
479 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
480 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
481 a1a.stru_24.SetIdentified();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
482 a1a.uObjectDescID = v18;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
483 a1a.stru_24.uSpecEnchantmentType = v34;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
484 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
485 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
486 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
487 result = a1a.stru_24.GenerateArtifact();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
488 if ( !result )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
489 return result;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
490 v23 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
491 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
492 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
493 v26 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
494 for( int i = 0; i < pObjectList->uNumObjects; i++ )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
495 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
496 if( v24 == pObjectList->pObjects[i].uObjectID )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
497 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
498 v26 = i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
499 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
500 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
501 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
502 a1a.uObjectDescID = v26;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
503 a1a.stru_24.Reset();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
504 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
505 a1a.vPosition.y = a2->vPosition.y;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
506 a1a.uAttributes = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
507 a1a.uSoundID = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
508 a1a.uFacing = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
509 a1a.vPosition.z = a2->vPosition.z;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
510 a1a.vPosition.x = a2->vPosition.x;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
511 a1a.spell_skill = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
512 a1a.spell_level = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
513 a1a.spell_id = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
514 a1a.spell_target_pid = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
515 a1a.spell_caster_pid = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
516 a1a.uSpriteFrameID = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
517 a1a.uSectorID = pIndoor->GetSector(a2->vPosition.x, a2->vPosition.y, a2->vPosition.z);;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
518 return a1a.Create(0, 0, 0, 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
519 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
520