Decompile fn_23851 (CSession::HasTrackedAchievement)

Batch #17868 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_23851 CSession::HasTrackedAchievement: logic confirmed by peer review

Peer-reviewed-by: Yommy, codeplay, bibinir
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-12 05:01:28 +00:00
commit e2c01faac9
2 changed files with 9 additions and 7 deletions

View file

@ -6,9 +6,13 @@
#include "Contents/Actors/Pc.h"
#include "Contents/World/World.h"
#include <algorithm>
#include <cstdint>
#include <map>
template __declspec(noinline) SessionRecord6178Entry* std::allocator<SessionRecord6178Entry>::allocate(std::size_t);
template __declspec(noinline) std::vector<SessionRecord6178Entry>::~vector() noexcept;
// OFFSET: 0x00E1D6B0
// FUNCTION: fn_23850
int CSession::IsState291To303(int state) const {
@ -34,13 +38,9 @@ int CSession::IsState291To303(int state) const {
// OFFSET: 0x00E1D700
// FUNCTION: fn_23851
bool CSession::HasTrackedAchievement(int id) const {
auto it = this->trackedAchievements.begin();
for (; it != this->trackedAchievements.end(); ++it) {
const SessionRecord6178 record = *it;
if (id == record.id) {
break;
}
}
const auto it = std::find_if(this->trackedAchievements.begin(), this->trackedAchievements.end(), [id](SessionRecord6178 record) {
return id == record.id;
});
return it != this->trackedAchievements.end();
}

View file

@ -2,9 +2,11 @@
#include <cstdint>
#include <map>
#include <string>
#include <xtree>
using SummonHpTree = std::_Tree<std::_Tmap_traits<
std::int64_t, std::int64_t, std::less<std::int64_t>, std::allocator<std::pair<const std::int64_t, std::int64_t>>, false>>;
extern template std::_Tree_find_result<std::_Tree_node<std::pair<const std::int64_t, std::int64_t>, void*>*>
SummonHpTree::_Find_lower_bound<std::int64_t>(const std::int64_t&) const;
extern template std::string::basic_string(const std::string&);