diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 9de50fcc73..1d6482b182 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -2688,8 +2688,13 @@ int npc_parseview(const char* w4, const char* start, const char* buffer, const c // Check if constant exists and get its value. if(!script_get_constant(viewid, &val_tmp)) { - ShowWarning("npc_parseview: Invalid NPC constant '%s' specified in file '%s', line'%d'. Defaulting to INVISIBLE. \n", viewid, filepath, strline(buffer,start-buffer)); - val = JT_INVISIBLE; + std::shared_ptr mob = mobdb_search_aegisname(viewid); + if (mob != nullptr) + val = static_cast(mob->vd.class_); + else { + ShowWarning("npc_parseview: Invalid NPC constant '%s' specified in file '%s', line'%d'. Defaulting to INVISIBLE. \n", viewid, filepath, strline(buffer,start-buffer)); + val = JT_INVISIBLE; + } } else val = static_cast(val_tmp); } diff --git a/src/map/status.cpp b/src/map/status.cpp index 9279ac046d..9897744e65 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -8886,10 +8886,12 @@ void status_set_viewdata(struct block_list *bl, int class_) nd->vd.class_ = class_; nd->vd.hair_style = cap_value(nd->vd.hair_style, MIN_HAIR_STYLE, MAX_HAIR_STYLE); } else { + ShowError("status_set_viewdata (NPC): Invalid view data %d\n", class_); if (bl->m >= 0) ShowDebug("Source (NPC): %s at %s (%d,%d)\n", nd->name, map_mapid2mapname(bl->m), bl->x, bl->y); else ShowDebug("Source (NPC): %s (invisible/not on a map)\n", nd->name); + ShowDebug( "Source (NPC): %s is located in: %s\n", nd->name, nd->path ); } break; }