FactionType and FactionSlot resetting
#5

Quote:
Originally Posted by AndreT
Посмотреть сообщение
Why do you use indexes 10 and 11? According to my logic and a quick look at the file, it should be 9 and 10.

Also, you could dowsize your function a little bit seeing that the length of one parsed part won't go over something like 32 characters most likely.
The 5th parameter of strmid as well, either can be left unspecified (so it will be sizeof the first parameter) or you should dowsize it to the size of the destination array.
And another thing: if you detect that the line has no faction or the faction has no name, simply pass on to the next line or jump out of the loop completely (assuming there are no "blank" factions between others):
pawn Код:
fread(file, strFromFile2);
if(strFromFile2[0] == '|' && strFromFile2[1] == '|') // First 2 chars are: ||
{
    continue; // move on to the next line
    //break; // stop moving through lines (uncomment for this behavior)
}
// split, etc.
Sorry if I'm being a noob, but could you put that in the code for me please, since it seems a bit hard... Thanks.
Reply


Messages In This Thread
FactionType and FactionSlot resetting - by seanny - 16.04.2012, 14:10
Re: FactionType and FactionSlot resetting - by AndreT - 16.04.2012, 14:14
Re: FactionType and FactionSlot resetting - by seanny - 16.04.2012, 14:29
Re: FactionType and FactionSlot resetting - by AndreT - 16.04.2012, 15:09
Re: FactionType and FactionSlot resetting - by seanny - 16.04.2012, 17:29

Forum Jump:


Users browsing this thread: 1 Guest(s)