HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Preventing overflow of skills

View previous topic View next topic Go down 
AuthorMessage
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Preventing overflow of skills   Tue Jan 29, 2013 9:09 pm

In MagixPlayer.h
Remove the Red code
Quote :
void addSkill(const String &name, const unsigned short &stock)
{
for(vector<Skill>::type::iterator it = skillSlot.begin(); it != skillSlot.end(); it++)
{
Skill *skill = &*it;
if(skill->name == name)
{
skill->stock += stock;
if(skill->stock>MAX_SKILLSTOCK)skill->stock = MAX_SKILLSTOCK;

skillChangedList.push_back(Skill(name,skill->stock));
return;
}
}
skillSlot.push_back(Skill(name,(stock>MAX_SKILLSTOCK?MAX_SKILLSTOCK:stock)));
skillChangedList.push_back(Skill(name,(stock>MAX_SKILLSTOCK?MAX_SKILLSTOCK:stock)));
}


Add in the green code
Quote :
void addSkill(const String &name, const unsigned short &stock)
{
for(vector<Skill>::type::iterator it = skillSlot.begin(); it != skillSlot.end(); it++)
{
Skill *skill = &*it;
if(skill->name == name)
{
skill->stock = Math::Clamp(skill->stock+stock, 0, MAX_SKILLSTOCK);
skillChangedList.push_back(Skill(name,skill->stock));
return;
}
}
skillSlot.push_back(Skill(name,(stock>MAX_SKILLSTOCK?MAX_SKILLSTOCK:stock)));
skillChangedList.push_back(Skill(name,(stock>MAX_SKILLSTOCK?MAX_SKILLSTOCK:stock)));
}

________________________________
Retired
Back to top Go down
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 740
Join date : 2011-11-27

PostSubject: Re: Preventing overflow of skills   Wed Jan 30, 2013 9:17 am

You are a legend Redeye.
So many complaints from players
Adding the code now.
Thank you
~Lazyzim~
Back to top Go down
Clove



Posts : 135
Join date : 2012-11-03

PostSubject: Re: Preventing overflow of skills   Mon Mar 18, 2013 7:45 am

Question, sorry for necro bumping but I have to ask. What do you mean by overflow of skills? I have a feeling what I'm thinking of is different to what it really means.
Back to top Go down
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: Preventing overflow of skills   Mon Mar 18, 2013 7:51 am

200+60=4 overflow

________________________________
Retired
Back to top Go down
CryKlawz

avatar

Game username : CryKlawz
Server : Last World
Female Posts : 32
Join date : 2012-12-21

PostSubject: Re: Preventing overflow of skills   Mon Oct 14, 2013 6:26 pm

Thanks for this,
RedEye.
Its gonna be really helpful once I get my server going ^^
Back to top Go down
 
Preventing overflow of skills
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: START HERE :: KITO's IT Source Code :: Bugs & Patches-
Jump to: