mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
[Crash Fix] Guard against Spells:MaxTotalSlotsPET being set above client allowed maximum. (#3507)
* Guard against MaxTotalSlotsPET being set too high This prevents a crash from MaxTotalSlotsPET being set too high. * Tweak
This commit is contained in:
parent
b5652e6010
commit
c30074be66
@ -3303,7 +3303,8 @@ void ZoneDatabase::SavePetInfo(Client *client)
|
||||
|
||||
// build pet buffs into struct
|
||||
int pet_buff_count = 0;
|
||||
int max_slots = RuleI(Spells, MaxTotalSlotsPET);
|
||||
// Guard against setting the maximum pet slots above the client allowed maximum.
|
||||
int max_slots = RuleI(Spells, MaxTotalSlotsPET) > PET_BUFF_COUNT ? PET_BUFF_COUNT : RuleI(Spells, MaxTotalSlotsPET);
|
||||
|
||||
// count pet buffs
|
||||
for (int index = 0; index < max_slots; index++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user