File tree 2 files changed +10
-9
lines changed
2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -143,14 +143,13 @@ struct MapNode
143
143
{
144
144
*this = n;
145
145
}
146
-
147
- MapNode (content_t content=CONTENT_AIR, u8 a_param1=0 , u8 a_param2=0 )
148
- {
149
- param0 = content;
150
- param1 = a_param1;
151
- param2 = a_param2;
152
- }
153
-
146
+
147
+ MapNode (content_t content = CONTENT_AIR, u8 a_param1=0 , u8 a_param2=0 )
148
+ : param0(content),
149
+ param1 (a_param1),
150
+ param2(a_param2)
151
+ { }
152
+
154
153
// Create directly from a nodename
155
154
// If name is unknown, sets CONTENT_IGNORE
156
155
MapNode (INodeDefManager *ndef, const std::string &name,
Original file line number Diff line number Diff line change @@ -180,7 +180,9 @@ void VoxelManipulator::addArea(const VoxelArea &area)
180
180
dstream<<std::endl;*/
181
181
182
182
// Allocate and clear new data
183
- MapNode *new_data = new MapNode[new_size];
183
+ // FIXME: UGLY KLUDGE because MapNode default constructor is FUBAR; it
184
+ // initialises data that is going to be overwritten anyway
185
+ MapNode *new_data = (MapNode*)new char [new_size * sizeof (*new_data)];
184
186
assert (new_data);
185
187
u8 *new_flags = new u8[new_size];
186
188
assert (new_flags);
You can’t perform that action at this time.
1 commit comments
HybridDog commentedon Dec 24, 2014
How large?