Fixed achievementexists script command (#4379)

Fixes #4378

Thanks to @ecdarreola and @teededung
This commit is contained in:
Lemongrass3110 2019-10-02 08:19:03 +02:00 committed by GitHub
parent 58f1fdf206
commit f290bc97be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -10362,7 +10362,7 @@ Returns true on success and false on failure.
*achievementexists(<achievement id>{,<char id>});
This function will return if the achievement exists on the player or the supplied
<char id>.
<char id> and is completed.
Returns true on success and false on failure.
---------------------------------------

View File

@ -23808,7 +23808,7 @@ BUILDIN_FUNC(achievementexists) {
}
}
ARR_FIND(0, sd->achievement_data.count, i, sd->achievement_data.achievements[i].achievement_id == achievement_id);
ARR_FIND(0, sd->achievement_data.count, i, sd->achievement_data.achievements[i].achievement_id == achievement_id && sd->achievement_data.achievements[i].completed > 0 );
script_pushint(st, i < sd->achievement_data.count ? true : false);
return SCRIPT_CMD_SUCCESS;
}