alexdantas / nSnake

The classic snake game with textual interface
http://nsnake.alexdantas.net
GNU General Public License v3.0
196 stars 57 forks source link

Segfault on loading level "Random" #13

Closed EvergreenTheTree closed 10 years ago

EvergreenTheTree commented 10 years ago
#0  0x00007ffff74c5630 in std::string::assign(std::string const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x000000000042cc7a in GameStateMainMenu::update() ()
#2  0x000000000042c547 in StateManager::run() ()
#3  0x000000000040652f in main ()
alexdantas commented 10 years ago

Wow, thanks a lot for commenting and providing a detailed backlog!

I've inspected the code and it seems this error only happens when you have no levels. Do your Level Select menu only have two options (Back and Random)?

You could try copying the files inside the levels/ directory to your ~/.local/share/nsnake/levels/.

$ cp levels/*.nsnake ~/.local/share/nsnake/levels/

Anyway I should fix this as soon as I get home. Will probably make it spawn a dialog or something.

EvergreenTheTree commented 10 years ago

Yes, there is only back and random in the level select menu. Thanks for the info though. As for the detailed report, I have done bug reports before so no problem. :-)

EvergreenTheTree commented 10 years ago

Also, I didn't do sudo make install so that might be why. I sometimes prefer to compile and install things locally.

alexdantas commented 10 years ago

Oh right, I should've taken that into consideration. When you run make run it executes locally, but doesn't copy the level files. I'll comment here when I add an in-game warning dialog or something.

Again, thanks for commenting. If you have any suggestions or something, feel free to talk as much as you want.

EvergreenTheTree commented 10 years ago

I am learning c, and have done a lot in python (including ncurses) so I may be able to help with this project very soon.

alexdantas commented 10 years ago

@4Evergreen4 , awesome! Can't wait to hear more from you, then. If you have any doubts about the code, don't mind asking.

Even though C++ is kinda different from C, you shouldn't have much difficulty using it.