annotate MapInfo.cpp @ 2484:cc7019a533fc

Fixing dereferencing of an integer instead of a pointer to it
author Grumpy7
date Sat, 06 Sep 2014 21:45:26 +0200
parents 104fdbea0386
children 5abd8fc8f1c6
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"
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
13
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
14
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
15 #include "Level/Decoration.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
16 #include "DecorationList.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
17 #include "Party.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
18 #include "OurMath.h"
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
19
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
20
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
21
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
22 //----- (00453F62) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
23 void MapStats::Initialize()
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
24 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
25 char work_str[32]; // [sp+Ch] [bp-34h]@3
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
26 int work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
27 int work_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
28 int i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
29 char* test_string;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
30 unsigned char c;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
31 bool break_loop;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
32 unsigned int temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
33 char* tmp_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
34 int decode_step;
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
35 // int item_counter;
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
36
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2334
diff changeset
37 free(pMapStatsTXT_Raw);
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
38 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
39 strtok(pMapStatsTXT_Raw, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
40 strtok(NULL, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
41 strtok(NULL, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
42
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
43 for (i=1; i<77; ++i)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
44 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
45 test_string = strtok(NULL, "\r") + 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
46 break_loop = false;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
47 decode_step=0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
48 do
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
49 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
50 c = *(unsigned char*)test_string;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
51 temp_str_len = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
52 while((c!='\t')&&(c>0))
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
53 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
54 ++temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
55 c=test_string[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 tmp_pos=test_string+temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
58 if (*tmp_pos == 0)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
59 break_loop = true;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
60 *tmp_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
61 if (temp_str_len)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
62 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
63 switch (decode_step)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
64 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
65 case 1:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
66 pInfos[i].pName = RemoveQuotes(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 2:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
69 pInfos[i].pFilename = RemoveQuotes(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 3:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
72 pInfos[i].uNumResets = 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 4:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
75 pInfos[i].uFirstVisitedAt = 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 5:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
78 pInfos[i]._per = 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 6:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
81 pInfos[i].uRespawnIntervalDays = 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 7:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
84 pInfos[i]._alert_days = 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 8:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
87 pInfos[i]._steal_perm = 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 9:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
90 pInfos[i].LockX5 = 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 10:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
93 pInfos[i].Trap_D20 = 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 11:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
96 pInfos[i].Treasure_prob = 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 12:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
99 pInfos[i].Encounter_percent = 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 13:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
102 pInfos[i].EncM1percent = 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 14:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
105 pInfos[i].EncM2percent = atoi(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 15:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
108 pInfos[i].EncM3percent = 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 16:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
111 pInfos[i].pEncounterMonster1Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
112 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
113 case 18:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
114 pInfos[i].Dif_M1 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
115 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
116 case 19:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
117 pInfos[i].uEncounterMonster1AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
118 pInfos[i].uEncounterMonster1AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
119 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
120 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
121 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
122 if (work_str_len )
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 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
125 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
126 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
127 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
128 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
129 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
130 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
131 pInfos[i].uEncounterMonster1AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
132 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
133 pInfos[i].uEncounterMonster1AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
134 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
135 pInfos[i].uEncounterMonster1AtMost = pInfos[i].uEncounterMonster1AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
136 }
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 20:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
139 pInfos[i].pEncounterMonster2Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
140 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
141 case 22:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
142 pInfos[i].Dif_M2 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
143 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
144 case 23:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
145 pInfos[i].uEncounterMonster2AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
146 pInfos[i].uEncounterMonster2AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
147 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
148 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
149 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
150 if (work_str_len )
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 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
153 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
154 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
155 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
156 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
157 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
158 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
159 pInfos[i].uEncounterMonster2AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
160 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
161 pInfos[i].uEncounterMonster2AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
162 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
163 pInfos[i].uEncounterMonster2AtMost = pInfos[i].uEncounterMonster2AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
164 }
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 24:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
167 pInfos[i].pEncounterMonster3Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
168 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
169 case 26:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
170 pInfos[i].Dif_M3 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
171 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
172 case 27:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
173 pInfos[i].uEncounterMonster3AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
174 pInfos[i].uEncounterMonster3AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
175 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
176 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
177 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
178 if (work_str_len )
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 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
181 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
182 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
183 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
184 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
185 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
186 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
187 pInfos[i].uEncounterMonster3AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
188 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
189 pInfos[i].uEncounterMonster3AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
190 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
191 pInfos[i].uEncounterMonster3AtMost = pInfos[i].uEncounterMonster3AtLeast;
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 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
194 case 28:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
195 pInfos[i].uRedbookTrackID = atoi(test_string);
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 case 29:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
198 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
199 if ( !strcmp(test_string, "CAVE") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
200 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
201 pInfos[i].uEAXEnv = 8;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
202 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
203 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
204 if ( !strcmp(test_string, "STONEROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
205 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
206 pInfos[i].uEAXEnv = 5;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
207 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
208 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
209 if ( !strcmp(test_string, "MOUNTAINS") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
210 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
211 pInfos[i].uEAXEnv = 17;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
212 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
213 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
214 if ( !strcmp(test_string, "PLAIN") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
215 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
216 pInfos[i].uEAXEnv = 19;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
217 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
218 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
219 if ( !strcmp(test_string, "FOREST") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
220 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
221 pInfos[i].uEAXEnv = 15;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
222 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
223 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
224 if ( !strcmp(test_string, "CITY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
225 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
226 pInfos[i].uEAXEnv = 16;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
227 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
228 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
229 if ( !strcmp(test_string, "UNDERWATER") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
230 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
231 pInfos[i].uEAXEnv = 22;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
232 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
233 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
234 if ( !strcmp(test_string, "ARENA") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
235 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
236 pInfos[i].uEAXEnv = 9;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
237 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
238 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
239 if ( !strcmp(test_string, "GENERIC") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
240 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
241 pInfos[i].uEAXEnv = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
242 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
243 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
244 if ( !strcmp(test_string, "PADDEDCELL") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
245 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
246 pInfos[i].uEAXEnv = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
247 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
248 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
249 if ( !strcmp(test_string, "ROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
250 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
251 pInfos[i].uEAXEnv = 2;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
252 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
253 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
254 if ( !strcmp(test_string, "BATHROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
255 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
256 pInfos[i].uEAXEnv = 3;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
257 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
258 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
259 if ( !strcmp(test_string, "LIVINGROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
260 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
261 pInfos[i].uEAXEnv = 4;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
262 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
263 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
264 if ( !strcmp(test_string, "AUDITORIUM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
265 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
266 pInfos[i].uEAXEnv = 6;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
267 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
268 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
269 if ( !strcmp(test_string, "CONCERTHALL") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
270 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
271 pInfos[i].uEAXEnv = 7;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
272 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
273 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
274 if ( !strcmp(test_string, "HANGAR") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
275 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
276 pInfos[i].uEAXEnv = 10;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
277 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
278 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
279 if ( !strcmp(test_string, "CARPETEDHALLWAY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
280 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
281 pInfos[i].uEAXEnv = 11;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
282 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
283 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
284 if ( !strcmp(test_string, "HALLWAY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
285 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
286 pInfos[i].uEAXEnv = 12;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
287 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
288 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
289 if ( !strcmp(test_string, "STONECORRIDOR") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
290 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
291 pInfos[i].uEAXEnv = 13;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
292 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
293 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
294 if ( !strcmp(test_string, "ALLEY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
295 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
296 pInfos[i].uEAXEnv = 14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
297 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
298 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
299 if ( !strcmp(test_string, "QUARRY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
300 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
301 pInfos[i].uEAXEnv = 18;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
302 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
303 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
304 if ( !strcmp(test_string, "PARKINGLOT") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
305 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
306 pInfos[i].uEAXEnv = 20;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
307 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
308 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
309 if ( !strcmp(test_string, "SEWERPIPE") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
310 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
311 pInfos[i].uEAXEnv = 21;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
312 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
313 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
314 if ( !strcmp(test_string, "DRUGGED") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
315 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
316 pInfos[i].uEAXEnv = 23;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
317 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
318 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
319 if ( !strcmp(test_string, "DIZZY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
320 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
321 pInfos[i].uEAXEnv = 24;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
322 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
323 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
324 if ( !strcmp(test_string, "PSYCHOTIC") )
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 pInfos[i].uEAXEnv = 25;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
327 break;
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 pInfos[i].uEAXEnv = 26;
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 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
332 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
333 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
334 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
335 else
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 break_loop = true;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
338 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
339 ++decode_step;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
340 test_string=tmp_pos+1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
341 } while ((decode_step<31)&&!break_loop);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
342 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
343
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
344 uNumMaps = 77;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
345 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
346 // 453F62: using guessed type char Str[32];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
347
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
348 //----- (00410D99) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
349 int MapStats::sub_410D99_get_map_index(int a1)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
350 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
351 for (int i = 1; i <= pMapStats->uNumMaps; i++)
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 if (_stricmp(pMapStats->pInfos[i].pFilename, pGames_LOD->pSubIndices[a1].pFilename) )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
354 return i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
355 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
356 Error("Map not found");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
357 return -1;
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
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
360 //----- (004547A3) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
361 MAP_TYPE MapStats::GetMapInfo(const char *Str2)
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 Assert(uNumMaps >= 2);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
364
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
365 for (uint i = 1; i < uNumMaps; ++i)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
366 if (!_stricmp(pInfos[i].pFilename, Str2))
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
367 return (MAP_TYPE)i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
368
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
369 Error("Map not found!");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
370 return (MAP_TYPE)-1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
371 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
372
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
373
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
374 //----- (0044FFD8) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
375 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
376 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
377 //MapInfo *v2; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
378 //SpawnPointMM7 *v3; // esi@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
379 //int v4; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
380 int v5; // edx@1
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
381 // int v6; // eax@1
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
382 int v7; // ecx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
383 int v8; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
384 int v9; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
385 signed int v10; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
386 signed int result; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
387 signed __int64 v12; // qtt@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
388 int v13; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
389 int v14; // edx@10
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
390 signed int v15; // ebx@20
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
391 unsigned __int16 v16; // dx@20
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
392 // ObjectDesc *v17; // ecx@21
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
393 unsigned __int16 v18; // ax@24
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
394 int v19; // ST0C_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
395 int v20; // ST08_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
396 int v21; // ST04_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
397 int v22; // eax@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
398 signed int v23; // ebx@29
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
399 unsigned __int16 v24; // dx@29
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2259
diff changeset
400 // ObjectDesc *v25; // ecx@30
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
401 unsigned __int16 v26; // ax@33
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
402 //int v27; // ecx@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
403 //int v28; // eax@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
404 //int v29; // esi@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
405 //__int16 v30; // ax@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
406 SpriteObject a1a; // [sp+Ch] [bp-7Ch]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
407 //int v32; // [sp+7Ch] [bp-Ch]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
408 //int v33; // [sp+80h] [bp-8h]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
409 int v34; // [sp+84h] [bp-4h]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
410
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
411 //auto a1 = this;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
412 //v2 = a1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
413 //v3 = a2;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
414 //v4 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
415 v34 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
416 v5 = rand() % 100;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
417 // v6 = 2 * (v2->Treasure_prob + 7 * v3->uIndex) - 14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
418 v7 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
419 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
420 //v32 = v5;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
421 //v33 = v7;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
422 v9 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
423 v10 = v8 - v7 + 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
424 v12 = v9;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
425 result = v9 / v10;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
426 v13 = v7 + (unsigned __int64)(v12 % v10);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
427 if ( v13 < 7 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
428 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
429 if ( v5 < 20 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
430 return result;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
431 if ( v5 >= 60 )
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 v19 = a2->vPosition.z;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
434 v20 = a2->vPosition.y;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
435 v21 = a2->vPosition.x;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
436 v22 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
437 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
438 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
439 if ( a2->uIndex == 1 )
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() % 51 + 50;
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 == 2 )
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() % 101 + 100;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
448 a1a.stru_24.uItemID = 197;
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 == 3 )
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() % 301 + 200;
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 == 4 )
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() % 501 + 500;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
460 a1a.stru_24.uItemID = 198;
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 == 5 )
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() % 1001 + 1000;
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 else if ( a2->uIndex == 6 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
470 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
471 v14 = rand() % 3001 + 2000;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
472 a1a.stru_24.uItemID = 199;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
473 v34 = v14;
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 v15 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
476 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
477 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
478 v18 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
479 for( int i = 0; i < pObjectList->uNumObjects; i++ )
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 if ( pObjectList->pObjects[i].uObjectID == v16 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
482 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
483 v18 = i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
484 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
485 }
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 a1a.stru_24.SetIdentified();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
488 a1a.uObjectDescID = v18;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
489 a1a.stru_24.uSpecEnchantmentType = v34;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
490 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
491 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
492 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
493 result = a1a.stru_24.GenerateArtifact();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
494 if ( !result )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
495 return result;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
496 v23 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
497 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
498 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
499 v26 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
500 for( int i = 0; i < pObjectList->uNumObjects; i++ )
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 if( v24 == pObjectList->pObjects[i].uObjectID )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
503 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
504 v26 = i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
505 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
506 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
507 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
508 a1a.uObjectDescID = v26;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
509 a1a.stru_24.Reset();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
510 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
511 a1a.vPosition.y = a2->vPosition.y;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
512 a1a.uAttributes = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
513 a1a.uSoundID = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
514 a1a.uFacing = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
515 a1a.vPosition.z = a2->vPosition.z;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
516 a1a.vPosition.x = a2->vPosition.x;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
517 a1a.spell_skill = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
518 a1a.spell_level = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
519 a1a.spell_id = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
520 a1a.spell_target_pid = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
521 a1a.spell_caster_pid = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
522 a1a.uSpriteFrameID = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
523 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
524 return a1a.Create(0, 0, 0, 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
525 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
526
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
527 //----- (004498D5) --------------------------------------------------------
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
528 void TeleportToStartingPoint(MapStartPoint point)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
529 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
530 const char *model_name; // [sp-4h] [bp-84h]@6
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
531 char pName[128]; // [sp+8h] [bp-78h]@11
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
532
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
533 switch (point)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
534 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
535 case MapStartPoint_Party: model_name = "Party Start"; break;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
536 case MapStartPoint_North: model_name = "North Start"; break;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
537 case MapStartPoint_South: model_name = "South Start"; break;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
538 case MapStartPoint_East: model_name = "East Start"; break;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
539 case MapStartPoint_West: model_name = "West Start"; break;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
540 default:
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
541 Error("Invalid enum value: %u", point);
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
542 }
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
543
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
544 strcpy(pName, model_name);
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
545 if (pDecorationList->GetDecorIdByName(pName))
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
546 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
547
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
548 if ((signed int)uNumLevelDecorations > 0)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
549 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
550 for (uint i = 0; i < (signed int)uNumLevelDecorations; ++i)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
551 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
552 if (pLevelDecorations[i].uDecorationDescID == (signed __int16)pDecorationList->GetDecorIdByName(pName))
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
553 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
554 pParty->vPosition.x = pLevelDecorations[i].vPosition.x;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
555 pParty->vPosition.y = pLevelDecorations[i].vPosition.y;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
556 pParty->vPosition.z = pLevelDecorations[i].vPosition.z;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
557 pParty->uFallStartY = pParty->vPosition.z;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
558 pParty->sRotationY = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[i].field_1A) / 90;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
559 if (pLevelDecorations[i].field_10_y_rot)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
560 pParty->sRotationY = pLevelDecorations[i].field_10_y_rot;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
561 pParty->sRotationX = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
562 pParty->uFallSpeed = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
563 }
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
564 }
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
565 }
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
566 if (dword_5B65C0)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
567 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
568 if (_5B65A8_npcdata_uflags_or_other)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
569 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
570 if (_5B65AC_npcdata_fame_or_other)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
571 pParty->vPosition.y = _5B65AC_npcdata_fame_or_other;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
572 if (_5B65B0_npcdata_rep_or_other)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
573 {
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
574 pParty->vPosition.z = _5B65B0_npcdata_rep_or_other;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
575 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
576 }
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
577 if (_5B65B4_npcdata_loword_house_or_other != -1)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
578 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
579 if (_5B65B8_npcdata_hiword_house_or_other)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
580 pParty->sRotationX = _5B65B8_npcdata_hiword_house_or_other;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
581 if (dword_5B65BC)
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
582 pParty->uFallSpeed = dword_5B65BC;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
583 }
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
584 _5B65B4_npcdata_loword_house_or_other = -1;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
585 dword_5B65C0 = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
586 dword_5B65BC = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
587 _5B65B8_npcdata_hiword_house_or_other = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
588 _5B65B0_npcdata_rep_or_other = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
589 _5B65AC_npcdata_fame_or_other = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
590 _5B65A8_npcdata_uflags_or_other = 0;
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
591 }
0f17a30149ec cleaning project part 1
zipi
parents: 2415
diff changeset
592 }