I added some code to handle all the misc stats, even those not sent to the client. Currently only potency uses this system but it is simple, just a new map<> in entity.h, currently public but will move it to private and make a getter function if we keep it. To get a stat all you have to do is call stats[stat define] so if you want potency for the player you just use
Code: Select all
float player_potency = 0;
player_potency = player->stats[ITEM_STAT_POTENCY];
It does store floats but currently the code only takes sint16, another thing I will fix if we keep this. Any feedback on this would be appreciated.
PS - I know I said only potency uses this, but any obscure stat that isn't sent to the client will currently use this as well, just no way to verify it works in the UI right now, could add code to /test to print the stats to the chat window but was to lazy to do that.