소스 검색

Fixed achievementexists script command (#4379)

Fixes #4378

Thanks to @ecdarreola and @teededung
Lemongrass3110 5 년 전
부모
커밋
f290bc97be
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      doc/script_commands.txt
  2. 1 1
      src/map/script.cpp

+ 1 - 1
doc/script_commands.txt

@@ -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.
 
 ---------------------------------------

+ 1 - 1
src/map/script.cpp

@@ -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;
 }