celguar / mangosbot-bots

Bot AI Core from ike3 for cmangos/mangos classic/tbc/wotlk
https://github.com/cmangos/playerbots
84 stars 40 forks source link

Removed substrategies reset after bot is loaded from DB #319

Closed ike3 closed 7 months ago

ike3 commented 7 months ago

I.e., I remove ll -disenchant,-vendor, and save the character. the DB has loot strategy>equip,quest,skill,use - this is correct. Then it loads it back using virtual bool Load(string value) override { Set(value); return true; }; SubStrategyValue::Set() treats this value as +equip,+quest,+skill,+use and adds those 4 strategies to the default ones, restoring disenchant and vendor .

I think Load() needs to be changed to replace the value: virtual bool Load(string value) override { this->value = value; return true; }; - this fixes the problem.

Is there any other reason to call Set() on Load()?