Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

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 12:17:31pm UTC 

  1. /* save file names */
  2. #define UMAP_FILE = PLUGIN_GAMES_DIR "/amaze_umap.sav"
  3. #define MAP_FILE  = PLUGIN_GAMES_DIR "/amaze_map.sav"
  4.  
  5.  
  6. bool savegame(void)
  7. {
  8.         int x,y;
  9.         char map_unit;
  10.         int unit_fmt;
  11.         int fd;
  12.         char line[35];
  13.  
  14.         //line[36]='\r';
  15.         //line[37]='\n';       
  16.  
  17.         /* save umap */
  18.         rb->splash(0, "Saving game...");
  19.  
  20.         fd = rb->open(UMAP_FILE, O_RDWR| O_CREAT);
  21.         if(fd >= 0) {
  22.                 for(y=0; y < umap->maxy; y++) {
  23.                         for (x=0; x < umap->maxx; x++) {
  24.                                 map_unit = umap->coords[y][x].chr;
  25.                                 unit_fmt = umap->coords[y][x].attrib;
  26.  
  27.                                 if(map_unit == ' ')
  28.                                         if(unit_fmt == A_NORMAL)
  29.                                                 line[x] = ' ';
  30.                                         else
  31.                                                 line[x] = 'B';
  32.                                 else
  33.                                         line[x] = map_unit;
  34.                         }
  35.                         rb->write(fd,line,sizeof(line));
  36.                 }
  37.                 rb->close(fd);
  38.         }
  39.         else return false;
  40.  
  41.         /* save map */
  42.         fd=rb->open(MAP_FILE, O_WRONLY|O_CREAT);
  43.         if(fd >= 0) {
  44.                 for(y=0; y < map->maxy; y++) {
  45.                         for (x=0; x < map->maxx; x++) {
  46.                                 map_unit = map->coords[y][x].chr;
  47.                                 unit_fmt = map->coords[y][x].attrib;
  48.                                 if(map_unit == ' ')
  49.                                         if(unit_fmt == A_NORMAL)
  50.                                                 line[x] = ' ';
  51.                                         else
  52.                                                 line[x] = 'B';
  53.                                 else line[x] = map_unit;
  54.                         }
  55.                         rb->write(fd,line,sizeof(line));
  56.                 }
  57.                 rb->close(fd);
  58.         }
  59.         else return false;
  60.  
  61.         return true;
  62. }

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.

comments powered by Disqus
worth-right
worth-right