Decompile fn_06467 (CJobCodeForItem::IsJobAllowed)

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

- fn_06467 CJobCodeForItem::IsJobAllowed: logic confirmed by peer review

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-11 14:28:22 +00:00
commit f6e76cb7a3
7 changed files with 47 additions and 39 deletions

View file

@ -160,16 +160,21 @@ void CGroundScope::Render(int argument) {
const char* name;
std::uint32_t tint = color;
if (this->m_skillId == 0x7F0) {
name = g_serviceOptions.Get(0xE5) ? "effect\\mineffect\\new_poisonsmoke\\new_poisonsmoke_cast\\poi_magic_circle_1.tga"
: "effect\\new_poisonsmoke\\new_poisonsmoke_cast\\poi_magic_circle_1.tga";
} else if (this->m_skillId == 0x8A5) {
name = "effect\\new_comet\\new_comet_cast_magicrune\\new_comet_cast_magicrune.tga";
} else if (this->m_skillId == 0x149E) {
name = "effect\\competentia\\competentia_cast_bottom\\com_rune_01.tga";
tint = static_cast<unsigned char>(static_cast<int>(static_cast<float>(color >> 24) * 0.6f)) << 24 | 0xFFFFFF;
} else {
name = "effect\\magic_target.tga";
switch (this->m_skillId) {
case 0x7F0:
name = g_serviceOptions.Get(0xE5) ? "effect\\mineffect\\new_poisonsmoke\\new_poisonsmoke_cast\\poi_magic_circle_1.tga"
: "effect\\new_poisonsmoke\\new_poisonsmoke_cast\\poi_magic_circle_1.tga";
break;
case 0x8A5:
name = "effect\\new_comet\\new_comet_cast_magicrune\\new_comet_cast_magicrune.tga";
break;
case 0x149E:
name = "effect\\competentia\\competentia_cast_bottom\\com_rune_01.tga";
tint = static_cast<unsigned char>(static_cast<int>(static_cast<float>(color >> 24) * 0.6f)) << 24 | 0xFFFFFF;
break;
default:
name = "effect\\magic_target.tga";
break;
}
CTexture* texture = g_texMgr.Load(name, 0, false, true, false);

View file

@ -1131,11 +1131,13 @@ bool CCashEmotionMgr::AddEmotion(int packId, int emotionId, const char* name, in
bool inserted = false;
auto it = this->m_emotionsByPack.find(packId);
if (this->m_emotionsByPack.end() != it) {
return it->second.try_emplace(emotionId, packId, emotionId, name, actionIndex, frameIndex, actId, sprId).second;
auto result = it->second.try_emplace(emotionId, packId, emotionId, name, actionIndex, frameIndex, actId, sprId);
return result.second;
}
CashEmotionTable table;
if (table.try_emplace(emotionId, packId, emotionId, name, actionIndex, frameIndex, actId, sprId).second == true) {
auto result = table.try_emplace(emotionId, packId, emotionId, name, actionIndex, frameIndex, actId, sprId);
if (result.second == true) {
inserted = this->m_emotionsByPack.emplace(packId, table).second;
}

View file

@ -178,25 +178,26 @@ int CCheckAttendanceMgr::L_InsertCheckAttendanceReward(lua_State* state) {
const int day = static_cast<int>(lua_tonumber(state, -3));
const int item = static_cast<int>(lua_tonumber(state, -2));
std::string message;
if (item == 0) {
lua_pushboolean(state, 0);
message = FormatOwnedString("[InsertCheckAttendanceReward] Check ItemID : %d", 0);
} else {
const int count = static_cast<int>(lua_tonumber(state, -1));
if (count < 1) {
lua_pushboolean(state, 0);
message = FormatOwnedString("[InsertCheckAttendanceReward] Check ItemCnt : [%d] %d", item, count);
} else if (g_checkAttendanceMgr->m_rewards.insert(std::make_pair(day, lcReward(item, count))).second) {
lua_pushboolean(state, 1);
lua_pushstring(state, "good");
return 2;
} else {
lua_pushboolean(state, 0);
message = FormatOwnedString("[InsertCheckAttendanceReward] Check RewardInfo : %d [%s] %d", day, item, count);
}
lua_pushstring(state, FormatOwnedString("[InsertCheckAttendanceReward] Check ItemID : %d", 0).c_str());
return 2;
}
lua_pushstring(state, message.c_str());
const int count = static_cast<int>(lua_tonumber(state, -1));
if (count <= 0) {
lua_pushboolean(state, 0);
lua_pushstring(state, FormatOwnedString("[InsertCheckAttendanceReward] Check ItemCnt : [%d] %d", item, count).c_str());
return 2;
}
if (!g_checkAttendanceMgr->m_rewards.insert(std::make_pair(day, lcReward(item, count))).second) {
lua_pushboolean(state, 0);
lua_pushstring(state, FormatOwnedString("[InsertCheckAttendanceReward] Check RewardInfo : %d [%s] %d", day, item, count).c_str());
return 2;
}
lua_pushboolean(state, 1);
lua_pushstring(state, "good");
return 2;
}

View file

@ -92,13 +92,13 @@ bool CSpecialPopupMgr::Init() {
return false;
}
if (lua_toboolean(luaState.GetState(), -2)) {
return true;
if (!lua_toboolean(luaState.GetState(), -2)) {
std::string message = std::string("error found :") + lua_tostring(luaState.GetState(), -1);
MessageBoxA(NULL, message.c_str(), "CSpecialPopupMgr", 0);
return false;
}
std::string message = std::string("error found :") + lua_tostring(luaState.GetState(), -1);
MessageBoxA(NULL, message.c_str(), "CSpecialPopupMgr", 0);
return false;
return true;
}
// OFFSET: 0x007A7DB0

View file

@ -86,7 +86,7 @@ bool ITEM_INFO::HasCards() const {
const bool first = g_itemCardNames.contains(CardId(*this, 0));
const unsigned id = static_cast<unsigned>(std::atoi(this->itemId.c_str()));
if (id - 9001u <= 498 || id - 10000u <= 999 || CardId(*this, 0) == 254 || CardId(*this, 0) == 255 || !Equipment(*this)) {
if (id - 9001u <= 498 || id - 10000u <= 999 || CardId(*this, 0) == 254 || CardId(*this, 0) == 255 || Equipment(*this) != true) {
return first;
}

View file

@ -434,10 +434,10 @@ bool CJobCodeForItem::IsJobAllowed(int job, unsigned long code) {
switch (code) {
case 0xFFFFE: {
auto group = this->m_jobGroups.find(0);
if (group == this->m_jobGroups.end()) {
return false;
if (group != this->m_jobGroups.end()) {
return group->second.end() == group->second.find(job);
}
return group->second.end() == group->second.find(job);
return false;
}
case 0xFFFFF:
return true;

View file

@ -1156,7 +1156,7 @@ void UIMessengerGroupWnd::OnLBtnDown(int x, int y) {
gameMode->TargetActorByAid(member.accountId);
MessengerMember selectedMember = this->MemberAtIndex(this->selected);
if (this->mode == 1 && !g_session.m_lockMouse && !g_windowMgr.HasMiniPartyMember(selectedMember.accountId)) {
if (this->mode == 1 && g_session.m_lockMouse != true && g_windowMgr.HasMiniPartyMember(selectedMember.accountId) != true) {
gameMode->SetDragIds(29, this->selected);
if (!g_windowMgr.transientWnd) {
UIDragMiniPartyWnd* window = new (std::nothrow) UIDragMiniPartyWnd(selectedMember);
@ -1172,7 +1172,7 @@ void UIMessengerGroupWnd::OnLBtnDown(int x, int y) {
int index = 0;
for (const MessengerMember& entry : this->members) {
if (this->scrollTop * this->columns <= index && entry.valid && entry.accountId == selectedMember.accountId) {
if (index >= this->scrollTop * this->columns && entry.valid && entry.accountId == selectedMember.accountId) {
CGameActor* actor = entry.accountId == g_session.m_aid
? gameMode->scene->player
: static_cast<CGameActor*>(gameMode->scene->GetGameActorByAID(entry.accountId));