-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Recent Update for recalculateStats() #5854
Labels
bug
Something isn't working
Comments
The PR in question: #5744 |
/************************************************************************
* Function: recalculateStats()
* Purpose : Recalculate the total Stats for a PC (force update)
* Example : target:recalculateStats()
* Notes : See scripts/effects/obliviscence.lua
************************************************************************/
void CLuaBaseEntity::recalculateStats()
{
if (m_PBaseEntity->objtype == TYPE_PC)
{
auto* PChar{ static_cast<CCharEntity*>(m_PBaseEntity) };
jobpointutils::RefreshGiftMods(PChar);
charutils::BuildingCharSkillsTable(PChar);
charutils::CalculateStats(PChar);
charutils::BuildingCharTraitsTable(PChar);
charutils::CheckValidEquipment(PChar);
charutils::BuildingCharAbilityTable(PChar);
PChar->UpdateHealth();
PChar->pushPacket(new CCharJobsPacket(PChar));
PChar->pushPacket(new CCharStatsPacket(PChar));
PChar->pushPacket(new CCharSkillsPacket(PChar));
PChar->pushPacket(new CCharRecastPacket(PChar));
PChar->pushPacket(new CCharAbilitiesPacket(PChar));
PChar->pushPacket(new CCharUpdatePacket(PChar));
PChar->pushPacket(new CMenuMeritPacket(PChar));
PChar->pushPacket(new CMonipulatorPacket1(PChar));
PChar->pushPacket(new CMonipulatorPacket2(PChar));
PChar->pushPacket(new CCharSyncPacket(PChar));
}
} Called by |
That's a very expensive function |
I rolled back the PR in question so this will no longer happen 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I affirm:
OS / platform the server is running (if known)
Windows 10
Branch affected by issue
base
Steps to reproduce
In a recent update player:recalculateStats() functionality was added to gear_set. Lua. Due to the positioning of the function, there are no checks as to when to activate this function so in turn it performs the recalculation on every piece of gear swapped out. The effect we are seeing is phantom crash's in the map.exe with no errors, lag when performing gear swaps via Ashitacast, received will spike between 1500-3000, phantom crashing on simple aspects as warping or home point due to movement gear swapping. This is just what we have seen from testing over the last week.
Expected behavior
Removed the player:recalculateStats() from within Scripts>Globals>Gear_sets to resolve Received spike between 1500-3000 due to gear swapping via ashitacast. After removing the function our spike holds around 300-400 based on zone and surroundings.
The text was updated successfully, but these errors were encountered: