Skip to content

Commit

Permalink
Merge pull request #37803 from ifreund/migrate-direct-item-spawn
Browse files Browse the repository at this point in the history
Migrate direct item spawns
  • Loading branch information
ZhilkinSerg authored Feb 7, 2020
2 parents 8f085f4 + 6f354d1 commit e7271b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "enums.h"
#include "faction.h"
#include "game.h"
#include "item_factory.h"
#include "item_group.h"
#include "itype.h"
#include "json.h"
Expand Down Expand Up @@ -1057,7 +1058,9 @@ class jmapgen_loot : public jmapgen_piece

// All the probabilities are 100 because we do the roll in @ref apply.
if( group.empty() ) {
result_group.add_item_entry( name, 100 );
// Migrations are applied to item *groups* on load, but single item spawns must be
// migrated individually
result_group.add_item_entry( item_controller->migrate_id( name ), 100 );
} else {
result_group.add_group_entry( group, 100 );
}
Expand Down

0 comments on commit e7271b0

Please sign in to comment.