[Help]

Status
Not open for further replies.
Newbie Spellweaver
Joined
Oct 9, 2020
Messages
50
Reaction score
4
QQ图片20220417005303 - [Help] - RaGEZONE Forums QQ图片20220417005358 - [Help] - RaGEZONE Forums
Help, how to write the configuration file of this code. I wrote this to no avail! Thanks in advance
 
1. Whoever made the system: it's better to not use new and just emplace_back the actual object and just reserve some number preemptively.

2. Your issue:
You have it backwards. The first if check is for MONSTER and not an ID.
 
Upvote 0
1. Whoever made the system: it's better to not use new and just emplace_back the actual object and just reserve some number preemptively.

2. Your issue:
You have it backwards. The first if check is for MONSTER and not an ID.

MONSTER{ MI_GLAPHAN4}

This should be?
 
Upvote 0
scanner.GetToken() updates scanner.Token / scanner.token with the next string read. scanner.GetNumber() will convert that token in to a number. In this case, they convert the token using atoi just like GetNumber() does as well.

Before the loop starts, it tries to grab a token. Then the loop starts until the stream is essentially ended.Ifif the token at that state is MONSTER
Then it grabs another token. From the comment, this is expected to be an opening brace.
Then it grabs another token after and the comment states either a closing brace or an id.
Then it loops agai, butt this time while the scanner.Token is not a closing brace.

It creates a pointer of the struct type DPSProp using new allocating the memory to heap.
It assigns a variable from the structure dwID to the current token converted to a number by using atoi.
It then adds that pointer to a vector.
After doing so, it acquires another token. Meaning that the token could be another id or a closing brace. The loop will end if it is a closing brace; otherwise, it will repeat with the next id.

when it is a closing brace, that loops ends.

Then it acquires the next token (GetToken()) while in that if statement which is useless to be honest and shouldn't be there as the first two and the loop will handle that and the fact of the next GetTooutsideside of the if statement.
And after it acquires another token.
 
Upvote 0
Status
Not open for further replies.
Back