Skip to content

Commit

Permalink
Clarify unknown NPC error in mapgen
Browse files Browse the repository at this point in the history
This error occurs when the game is supplied an invalid npc_template for
`place_npcs` in a mapgen entry. However, it says it was supplied an
invalid npc class, which is a separate type, leading to confusion.
Also, stick the thing it's having a problem with there, just for
redundancy.
  • Loading branch information
anothersimulacrum committed Nov 21, 2020
1 parent 1a86883 commit 3719f3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,8 @@ class jmapgen_npc : public jmapgen_piece
npc_class( jsi.get_string( "class" ) )
, target( jsi.get_bool( "target", false ) ) {
if( !npc_class.is_valid() ) {
set_mapgen_defer( jsi, "class", "unknown npc class" );
set_mapgen_defer( jsi, "class", string_format( "unknown npc template %s",
jsi.get_string( "class" ) ) );
}
if( jsi.has_string( "add_trait" ) ) {
std::string new_trait = jsi.get_string( "add_trait" );
Expand Down

0 comments on commit 3719f3d

Please sign in to comment.