Fix the auto-correct mechanism on illegal faction

Auto correct was not using the new client_base_data for min/max.
This commit is contained in:
Paul Coene 2019-04-13 12:39:45 -04:00 committed by GitHub
parent 1603ea097f
commit 3105577c1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7810,9 +7810,9 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui
//
// Adjust these values for cases where starting faction is below
// min or above max by not allowing any earn in those directions.
this_faction_min = MIN_PERSONAL_FACTION - fm.base;
this_faction_min = fm.min - fm.base;
this_faction_min = std::min(0, this_faction_min);
this_faction_max = MAX_PERSONAL_FACTION - fm.base;
this_faction_max = fm.max - fm.base;
this_faction_max = std::max(0, this_faction_max);
// Get the characters current value with that faction
@ -7853,9 +7853,9 @@ void Client::SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class
// min or above max by not allowing any earn/loss in those directions.
// At least one faction starts out way below min, so we don't want
// to allow loses in those cases, just massive gains.
this_faction_min = MIN_PERSONAL_FACTION - fm.base;
this_faction_min = fm.min - fm.base;
this_faction_min = std::min(0, this_faction_min);
this_faction_max = MAX_PERSONAL_FACTION - fm.base;
this_faction_max = fm.max - fm.base;
this_faction_max = std::max(0, this_faction_max);
//Get the faction modifiers