Implemented new monster range (#2604)
With this the internal static array was changed to a std::map which manages it's memory dynamically when needed. Dropped mob_dummy since it was useless to have it in the first place. Replaced a lot of direct accesses to the mob db by the "get" function. With this you can now use 20021-31998 for monsters and also 4000-20020 will be used for player clones whenever needed. Dropped mobdb_exists Replaced almost all references to MAX_MOB_DB Moved MAX_MOB_DB from the header directly into the source file to make it only visible to the .cpp file itself and not to any other. Moved the mob drop calculation function from itemdb.cpp into mob.cpp, because it needs to iterate over the whole mob db. Added a few missing clone checks. Thanks to @lighta, @Jeybla and @aleos89.
This commit is contained in:
@@ -1027,7 +1027,7 @@ struct achievement_db *achievement_read_db_sub(yamlwrapper *wrapper, int n, cons
|
||||
for (tt = yaml_iterator_first(it); yaml_iterator_has_next(it) && entry->target_count < MAX_ACHIEVEMENT_OBJECTIVES; tt = yaml_iterator_next(it)) {
|
||||
int mobid = 0, count = 0;
|
||||
|
||||
if (yaml_node_is_defined(tt, "MobID") && (mobid = yaml_get_int(tt, "MobID")) && !mobdb_exists(mobid)) { // The mob ID field is not required
|
||||
if (yaml_node_is_defined(tt, "MobID") && (mobid = yaml_get_int(tt, "MobID")) && mob_db(mobid) == NULL) { // The mob ID field is not required
|
||||
ShowError("achievement_read_db_sub: Invalid mob ID %d for achievement %d in \"%s\", skipping.\n", mobid, achievement_id, source);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user