I'm creating a rpg and I'm having problems with an array sort. the following code is suppossed to sort through a list of skills and if the character already has the skill or if his stats don't allow him to take that skill then it won't be added to the list... but it doesn't seem to be working right. So if someone could help it would be nice.
Code:
int start,end,put=0;
int x;
Find_skill_type(type,skill_list,start,end);
for (x=start;x<=end;x++)
{
if ((skills[x]==0)&&(stats_allow_skill(stats,skill_list[x])==true))
{
menu_list[put]=x;
put++;
}
}
Find_skill_type() finds the start and end position of skills of a certain type from the main skill list.
stats_allow_skill() passes back true if he can take it or false if he can't
skills is the characters skill list (which corresponds to the same point in the skill_list array.)