Advertising
Paste Description for Trouble with rb-open
Compiler errors of "error syntax error before '=' token" pointing to each instance of rb->open
- Trouble with rb-open
- Thursday, October 4th, 2007 at 6:17:31am MDT
- /* save file names */
- #define UMAP_FILE = PLUGIN_GAMES_DIR "/amaze_umap.sav"
- #define MAP_FILE = PLUGIN_GAMES_DIR "/amaze_map.sav"
- bool savegame(void)
- {
- int x,y;
- char map_unit;
- int unit_fmt;
- int fd;
- char line[35];
- //line[36]='\r';
- //line[37]='\n';
- /* save umap */
- rb->splash(0, "Saving game...");
- fd = rb->open(UMAP_FILE, O_RDWR| O_CREAT);
- if(fd >= 0) {
- for(y=0; y < umap->maxy; y++) {
- for (x=0; x < umap->maxx; x++) {
- map_unit = umap->coords[y][x].chr;
- unit_fmt = umap->coords[y][x].attrib;
- if(map_unit == ' ')
- if(unit_fmt == A_NORMAL)
- line[x] = ' ';
- else
- line[x] = 'B';
- else
- line[x] = map_unit;
- }
- rb->write(fd,line,sizeof(line));
- }
- rb->close(fd);
- }
- else return false;
- /* save map */
- fd=rb->open(MAP_FILE, O_WRONLY|O_CREAT);
- if(fd >= 0) {
- for(y=0; y < map->maxy; y++) {
- for (x=0; x < map->maxx; x++) {
- map_unit = map->coords[y][x].chr;
- unit_fmt = map->coords[y][x].attrib;
- if(map_unit == ' ')
- if(unit_fmt == A_NORMAL)
- line[x] = ' ';
- else
- line[x] = 'B';
- else line[x] = map_unit;
- }
- rb->write(fd,line,sizeof(line));
- }
- rb->close(fd);
- }
- else return false;
- return true;
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.