Maintenance: [forced, user-approved] Family S3: remove ShortcutCooldowns (17 reinterpret_cast<ShortcutCooldowns&>(g_session.m_request
Batch #10274 by ragnarok-clanker: forced by an admin (3 lower score(s), 9 changed function(s)); checked with 348 compiled unit(s), including every includer of Source/Client/Mode/CGameMode.h, Source/Client/Session.h, Source/UI/Shortcuts/ShortcutCooldowns.h.
This commit is contained in:
parent
8cd42aee81
commit
514c8dc0cd
12 changed files with 96 additions and 123 deletions
|
|
@ -735,6 +735,9 @@ public:
|
|||
void ReceiveActorStatusValue(std::uint32_t aid, int status, int amount, int option);
|
||||
void ReceiveActorSkillResult(const unsigned char* packet);
|
||||
void UpdateSkillCooldown(std::uint16_t skill, std::uint32_t remaining, std::uint32_t duration);
|
||||
void LoadCooldownSnapshot(const void* packet);
|
||||
void ApplyCooldownStart(const void* packet);
|
||||
void LoadCooldownRecords(const void* packet);
|
||||
void sub_D5B030(
|
||||
std::uint32_t source, std::uint32_t target, std::uint16_t skill, std::uint16_t x, std::uint16_t y,
|
||||
int tick, int level, unsigned char flag, int result
|
||||
|
|
|
|||
|
|
@ -2600,26 +2600,26 @@ void CGameMode::ReceiveSimulationResult(const unsigned char* packet) {
|
|||
// OFFSET: 0x00D415C0
|
||||
// FUNCTION: fn_21825
|
||||
void CGameMode::UpdateSkillCooldown(std::uint16_t skill, std::uint32_t remaining, std::uint32_t duration) {
|
||||
SessionRequestTimer value;
|
||||
value.requestId = skill;
|
||||
ShortcutCooldownRecord value;
|
||||
value.id = skill;
|
||||
const std::uint32_t now = g_replayAnimationScaling == 1 ? Replay::Instance().elapsed : timeGetTime();
|
||||
value.readyTime = now + remaining;
|
||||
value.end = now + remaining;
|
||||
value.duration = duration;
|
||||
|
||||
for (const ShortcutCooldownIcon& icon : g_session.m_mainCooldownIcons) {
|
||||
if (icon.id == skill) {
|
||||
value.main.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, value.readyTime - remaining, duration - remaining, 0));
|
||||
value.main.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, value.end - remaining, duration - remaining, 0));
|
||||
}
|
||||
}
|
||||
|
||||
for (const ShortcutCooldownIcon& icon : g_session.m_alternateCooldownIcons) {
|
||||
if (icon.id == skill) {
|
||||
value.alternate.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, value.readyTime - remaining, duration - remaining, 0));
|
||||
value.alternate.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, value.end - remaining, duration - remaining, 0));
|
||||
}
|
||||
}
|
||||
|
||||
const auto found = std::find_if(g_session.m_requestTimers.begin(), g_session.m_requestTimers.end(), [skill](const SessionRequestTimer& timer) {
|
||||
return timer.requestId == skill;
|
||||
const auto found = std::find_if(g_session.m_requestTimers.begin(), g_session.m_requestTimers.end(), [skill](const ShortcutCooldownRecord& timer) {
|
||||
return timer.id == skill;
|
||||
});
|
||||
if (found == g_session.m_requestTimers.end()) {
|
||||
g_session.m_requestTimers.push_back(value);
|
||||
|
|
|
|||
|
|
@ -4906,34 +4906,34 @@ void CGameMode::ApplyStatusChange(
|
|||
this->scene->player->SetUnknown0305(1, value2);
|
||||
}
|
||||
} else if (type == 46) {
|
||||
SessionRequestTimer timer;
|
||||
timer.requestId = 577;
|
||||
timer.readyTime = now + remaining;
|
||||
ShortcutCooldownRecord timer;
|
||||
timer.id = 577;
|
||||
timer.end = now + remaining;
|
||||
timer.duration = total;
|
||||
g_session.m_requestTimers.push_back(timer);
|
||||
} else if (type == 684) {
|
||||
SessionRequestTimer timer;
|
||||
timer.requestId = 9999;
|
||||
timer.readyTime = now + remaining;
|
||||
ShortcutCooldownRecord timer;
|
||||
timer.id = 9999;
|
||||
timer.end = now + remaining;
|
||||
timer.duration = total;
|
||||
g_session.m_requestTimers.push_back(timer);
|
||||
} else if (type == 175) {
|
||||
SessionRequestTimer timer;
|
||||
ShortcutCooldownRecord timer;
|
||||
for (int requestId = 10000; requestId < 10020; ++requestId) {
|
||||
std::list<SessionRequestTimer>::iterator it = g_session.m_requestTimers.begin();
|
||||
std::list<ShortcutCooldownRecord>::iterator it = g_session.m_requestTimers.begin();
|
||||
for (; it != g_session.m_requestTimers.end(); ++it) {
|
||||
if (it->requestId == requestId) {
|
||||
if (it->id == requestId) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
timer.requestId = requestId;
|
||||
timer.readyTime = now + remaining;
|
||||
timer.id = requestId;
|
||||
timer.end = now + remaining;
|
||||
timer.duration = total;
|
||||
if (it == g_session.m_requestTimers.end()) {
|
||||
g_session.m_requestTimers.push_back(timer);
|
||||
} else {
|
||||
it->readyTime = timer.readyTime;
|
||||
it->end = timer.end;
|
||||
}
|
||||
}
|
||||
} else if (type == 824) {
|
||||
|
|
|
|||
|
|
@ -2329,13 +2329,13 @@ ITEM_INFO CSession::GetItem61B8(int index) const {
|
|||
// OFFSET: 0x00E31DE0
|
||||
// FUNCTION: fn_24177
|
||||
bool CSession::IsRequestReady(int requestId) {
|
||||
std::list<SessionRequestTimer>::iterator it = this->m_requestTimers.begin();
|
||||
std::list<ShortcutCooldownRecord>::iterator it = this->m_requestTimers.begin();
|
||||
for (; it != this->m_requestTimers.end(); ++it) {
|
||||
if (requestId == it->requestId || it->requestId == 0x241) {
|
||||
if (requestId == it->id || it->id == 0x241) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (it != this->m_requestTimers.end() && it->readyTime - 100 > timeGetTime()) {
|
||||
if (it != this->m_requestTimers.end() && it->end - 100 > timeGetTime()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -107,14 +107,6 @@ struct ProhibitionLogEntry {
|
|||
/* 0034 */ char ownerName[32];
|
||||
};
|
||||
|
||||
struct SessionRequestTimer {
|
||||
/* 0000 */ int requestId;
|
||||
/* 0004 */ unsigned long readyTime;
|
||||
/* 0008 */ std::uint32_t duration;
|
||||
/* 000C */ std::list<CooldownState> main;
|
||||
/* 0014 */ std::list<CooldownState> alternate;
|
||||
};
|
||||
|
||||
struct SessionRecord0734 {
|
||||
/* 0000 */ std::uint32_t unknown_0000 = 0;
|
||||
/* 0004 */ int id;
|
||||
|
|
@ -384,7 +376,7 @@ public:
|
|||
/* 53A0 */ unsigned char unknown_53A0[0x30];
|
||||
/* 53D0 */ unsigned char unknown_53D0[0x30];
|
||||
/* 5400 */ unsigned char unknown_5400[0x40];
|
||||
/* 5440 */ std::list<SessionRequestTimer> m_requestTimers;
|
||||
/* 5440 */ std::list<ShortcutCooldownRecord> m_requestTimers;
|
||||
/* 5448 */ int unknown_5448;
|
||||
/* 544C */ unsigned char unknown_544C[0x04];
|
||||
/* 5450 */ int unknown_5450;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue