@@ -54,7 +54,9 @@ BuildingTypeClassExtension::BuildingTypeClassExtension(BuildingTypeClass *this_p
54
54
ProduceCashBudget(0 ),
55
55
IsStartupCashOneTime(false ),
56
56
IsResetBudgetOnCapture(false ),
57
- IsEligibleForAllyBuilding(false )
57
+ IsEligibleForAllyBuilding(false ),
58
+ NumberOfDocks(0 ),
59
+ DockingOffsets()
58
60
{
59
61
ASSERT (ThisPtr != nullptr );
60
62
// EXT_DEBUG_TRACE("BuildingTypeClassExtension constructor - Name: %s (0x%08X)\n", ThisPtr->Name(), (uintptr_t)(ThisPtr));
@@ -167,6 +169,8 @@ void BuildingTypeClassExtension::Compute_CRC(WWCRCEngine &crc) const
167
169
// EXT_DEBUG_TRACE("BuildingTypeClassExtension::Compute_CRC - Name: %s (0x%08X)\n", ThisPtr->Name(), (uintptr_t)(ThisPtr));
168
170
169
171
crc (IsEligibleForAllyBuilding);
172
+ crc (NumberOfDocks);
173
+ crc (DockingOffsets.Count ());
170
174
}
171
175
172
176
@@ -181,12 +185,26 @@ bool BuildingTypeClassExtension::Read_INI(CCINIClass &ini)
181
185
// EXT_DEBUG_TRACE("BuildingTypeClassExtension::Read_INI - Name: %s (0x%08X)\n", ThisPtr->Name(), (uintptr_t)(ThisPtr));
182
186
EXT_DEBUG_WARNING (" BuildingTypeClassExtension::Read_INI - Name: %s (0x%08X)\n " , ThisPtr->Name (), (uintptr_t )(ThisPtr));
183
187
188
+ char buffer[1024 ];
189
+
184
190
const char *ini_name = ThisPtr->Name ();
191
+ const char *graphic_name = ThisPtr->Graphic_Name ();
185
192
186
193
if (!ini.Is_Present (ini_name)) {
187
194
return false ;
188
195
}
189
196
197
+ // if (!ArtINI.Is_Present(graphic_name)) {
198
+ // return false;
199
+ // }
200
+
201
+ /* *
202
+ * The following structures have at least one docking location.
203
+ */
204
+ if (ThisPtr->IsHelipad ) {
205
+ NumberOfDocks = 1 ;
206
+ }
207
+
190
208
GateUpSound = ini.Get_VocType (ini_name, " GateUpSound" , GateUpSound);
191
209
GateDownSound = ini.Get_VocType (ini_name, " GateDownSound" , GateDownSound);
192
210
@@ -199,6 +217,14 @@ bool BuildingTypeClassExtension::Read_INI(CCINIClass &ini)
199
217
200
218
IsEligibleForAllyBuilding = ini.Get_Bool (ini_name, " EligibleForAllyBuilding" ,
201
219
ThisPtr->IsConstructionYard ? true : IsEligibleForAllyBuilding);
220
+
221
+ NumberOfDocks = ini.Get_Int (ini_name, " NumberOfDocks" , NumberOfDocks);
222
+
223
+ for (int i = 0 ; i < NumberOfDocks; ++i) {
224
+ std::snprintf (buffer, sizeof (buffer), " DockingOffset%d" , i);
225
+ TPoint3D<int > offset = ArtINI.Get_Point (graphic_name, buffer, TPoint3D<int >(0 ,0 ,0 ));
226
+ DockingOffsets.Add (offset);
227
+ }
202
228
203
229
return true ;
204
230
}
0 commit comments