From 306de96d1b8d4eb34ea0983dd8afa5b25033df43 Mon Sep 17 00:00:00 2001 From: anothersimulacrum Date: Sat, 14 Nov 2020 11:59:13 -0800 Subject: [PATCH] Apply migrations to more jmapgens jmapgen_spawn_item and jmapgen_liquid_item did not migrate items passed to them. This showed up when spawning in a rural gas station with generic guns, a shotgun and shot for it would be spawned, but not migrated to the generic guns versions. Migrate those now. --- src/mapgen.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index ca93b36131d7..3b7754084a16 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1111,6 +1111,9 @@ class jmapgen_liquid_item : public jmapgen_piece amount( jsi, "amount", 0, 0 ) , liquid( jsi.get_string( "liquid" ) ) , chance( jsi, "chance", 1, 1 ) { + // Itemgroups apply migrations when being loaded, but we need to migrate + // individual items here. + liquid = item_controller->migrate_id( itype_id( liquid ) ); if( !item::type_is_defined( itype_id( liquid ) ) ) { set_mapgen_defer( jsi, "liquid", "no such item type '" + liquid + "'" ); } @@ -1389,6 +1392,9 @@ class jmapgen_spawn_item : public jmapgen_piece type( jsi.get_string( "item" ) ) , amount( jsi, "amount", 1, 1 ) , chance( jsi, "chance", 100, 100 ) { + // Itemgroups apply migrations when being loaded, but we need to migrate + // individual items here. + type = item_controller->migrate_id( type ); if( !item::type_is_defined( type ) ) { set_mapgen_defer( jsi, "item", "no such item" ); }