Added support of the aegis mob name in the script npc definition (view) (#6252)
* Added the npc path in status_set_viewdata warning Thanks to @Lemongrass3110
This commit is contained in:
parent
f4fbfb3299
commit
a725844553
@ -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<s_mob_db> mob = mobdb_search_aegisname(viewid);
|
||||
if (mob != nullptr)
|
||||
val = static_cast<int>(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<int>(val_tmp);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user