@@ -383,7 +383,6 @@ class zone_data
383
383
384
384
zone_data ( const std::string &_name, const zone_type_id &_type, const faction_id &_faction,
385
385
bool _invert, const bool _enabled,
386
- const tripoint_abs_ms &_start, const tripoint_abs_ms &_end,
387
386
const shared_ptr_fast<zone_options> &_options = nullptr ,
388
387
bool _is_displayed = false ) {
389
388
name = _name;
@@ -392,9 +391,6 @@ class zone_data
392
391
invert = _invert;
393
392
enabled = _enabled;
394
393
is_vehicle = false ;
395
- is_personal = false ;
396
- start = _start;
397
- end = _end;
398
394
is_displayed = _is_displayed;
399
395
400
396
// ensure that supplied options is of correct class
@@ -405,28 +401,26 @@ class zone_data
405
401
}
406
402
}
407
403
404
+ zone_data ( const std::string &_name, const zone_type_id &_type, const faction_id &_faction,
405
+ bool _invert, const bool _enabled,
406
+ const tripoint_abs_ms &_start, const tripoint_abs_ms &_end,
407
+ const shared_ptr_fast<zone_options> &_options = nullptr ,
408
+ bool _is_displayed = false )
409
+ : zone_data( _name, _type, _faction, _invert, _enabled, _options, _is_displayed ) {
410
+ is_personal = false ;
411
+ start = _start;
412
+ end = _end;
413
+ }
414
+
408
415
zone_data ( const std::string &_name, const zone_type_id &_type, const faction_id &_faction,
409
416
bool _invert, const bool _enabled,
410
417
const tripoint_rel_ms &_start, const tripoint_rel_ms &_end,
411
418
const shared_ptr_fast<zone_options> &_options = nullptr ,
412
- bool _is_displayed = false ) {
413
- name = _name;
414
- type = _type;
415
- faction = _faction;
416
- invert = _invert;
417
- enabled = _enabled;
418
- is_vehicle = false ;
419
+ bool _is_displayed = false )
420
+ : zone_data( _name, _type, _faction, _invert, _enabled, _options, _is_displayed ) {
419
421
is_personal = true ;
420
422
personal_start = _start;
421
423
personal_end = _end;
422
- is_displayed = _is_displayed;
423
-
424
- // ensure that supplied options is of correct class
425
- if ( _options == nullptr || !zone_options::is_valid ( type, *_options ) ) {
426
- options = zone_options::create ( type );
427
- } else {
428
- options = _options;
429
- }
430
424
}
431
425
432
426
// returns true if name is changed
0 commit comments