Decompile 2 functions in Source/Contents/World/WorldProximity.cpp

Batch #7544 by Toshiro: 0 byte-identical, 2 confirmed by peer review.

- fn_17686 CWorld::PcApproachToPlayer: logic confirmed by peer review
- fn_17687 CWorld::PlayerMove: logic confirmed by peer review

Peer-reviewed-by: eAthena, secret
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-10-31 10:22:36 +00:00
commit ae7cb57b3f

View file

@ -262,8 +262,26 @@ bool WorldProximityRangeCallback::Invoke() {
// OFFSET: 0x00AC9D50
// FUNCTION: fn_17686
__declspec(noinline) void CWorld::PcApproachToPlayer(std::uint32_t aid, const CellFloatPos& pos) {
if (this->player && this->player->Slot50() > 0 && this->IsGuildMaster(aid)) {
const float playerX = this->player->render.position.x;
const float playerZ = this->player->render.position.z;
const int range = this->nearbyRange;
CallWorldProximityUpdate(this, [playerX, playerZ, pos, range]() {
return std::fabs(pos.x - playerX) <= static_cast<float>(range) &&
std::fabs(pos.z - playerZ) <= static_cast<float>(range);
});
}
}
// OFFSET: 0x00AC9E70
// FUNCTION: fn_17687
void CWorld::PlayerMove(const float& x, const float& z) {
CallWorldProximityUpdate(this, [this, x, z]() {
return this->IsExistGuildMasterNearby(x, z);
});
}
// OFFSET: 0x00ACA9F0