Corrected mob availability database sprite lookup (#4502)

* Fixes #4495.
* Adjusted the monster sprite lookup to ignore any restrictions based on monster data.
Thanks to @sader1992!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Aleos 2020-01-01 22:30:12 -05:00 committed by GitHub
parent 50715f92e3
commit 6f52f6794f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4363,15 +4363,13 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "Mob", mob_name))
return 0;
uint32 mob_id = mobdb_searchname(mob_name.c_str());
struct mob_db *mob = mobdb_search_aegisname(mob_name.c_str());
if (mob_id == 0) {
if (mob == nullptr) {
this->invalidWarning(node["Mob"], "Unknown mob %s.\n", mob_name.c_str());
return 0;
}
struct mob_db *mob = mob_db(mob_id);
if (this->nodeExists(node, "Sprite")) {
std::string sprite;
@ -4386,12 +4384,14 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
return 0;
}
} else {
constant = mobdb_searchname(sprite.c_str());
struct mob_db *sprite_mob = mobdb_search_aegisname(sprite.c_str());
if (constant == 0) {
if (sprite_mob == nullptr) {
this->invalidWarning(node["Sprite"], "Unknown mob sprite constant %s.\n", sprite.c_str());
return 0;
}
constant = sprite_mob->vd.class_;
}
mob->vd.class_ = constant;