...I think you gonna get more trouble by handling file on later.
I would suggest you to use KeyValues (and/or SMC parse to read).
But let's continue with this File structure. With BINARY mode (rb)
I encounter first problem with
ReadString
Code:
// read about the file and author // Note! (char author[32])
WaypointHeader header;
fp.ReadString(header.author, sizeof(header.author), sizeof(header.author));
...this start read all data as STRING from first line until it hits string limit (32) or NULL terminate, which is end of file.
Means, it read even new lines.
example
map.ewp
Code:
author is me
9
2
5
end
fp.ReadString(header.author, sizeof(header.author), sizeof(header.author)); output
Code:
author is me
9
2
5
end
... if AUTHOR name is less than 32 bytes you can't get correct version numbers.
Using
ReadLine you can get one line at time.
But you need tell us in this point:
Are you gonna use waypoint files as normal TEXT file (so you can read with notepad)
Or are you gonna handle as binary file (this turn data to bytes so it is unreadable in notepad).
- How your waypoint file suppose to look at the end ?
*edit
Next you need replace Read ->
https://sm.alliedmods.net/new-api/files/File/ReadInt8 or else