Skip to content

Commit 533b7a2

Browse files
committed
remove monstergroup assign
There's only one instance, and optional/mandatory are better choices for JSON loading.
1 parent 793fa59 commit 533b7a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mongroup.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#include <string>
55
#include <utility>
66

7-
#include "assign.h"
87
#include "calendar.h"
98
#include "cata_utility.h"
109
#include "debug.h"
1110
#include "enum_conversions.h"
1211
#include "flexbuffer_json.h"
12+
#include "generic_factory.h"
1313
#include "mtype.h"
1414
#include "options.h"
1515
#include "rng.h"
@@ -554,7 +554,9 @@ void MonsterGroupManager::LoadMonsterGroup( const JsonObject &jo )
554554
g.replace_monster_group = jo.get_bool( "replace_monster_group", false );
555555
g.new_monster_group = mongroup_id( jo.get_string( "new_monster_group_id",
556556
mongroup_id::NULL_ID().str() ) );
557-
assign( jo, "replacement_time", g.monster_group_time, false, 1_days );
557+
if( jo.has_member( "replacement_time" ) ) {
558+
mandatory( jo, false, "replacement_time", g.monster_group_time, time_bound_reader{ 1_days } );
559+
}
558560
g.is_safe = jo.get_bool( "is_safe", false );
559561

560562
g.freq_total = jo.get_int( "freq_total", ( extending ? g.freq_total : 0 ) + freq_total );

0 commit comments

Comments
 (0)