Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1081790752 (LWP 21961)]
Being::isMonster (this=0x79) at being.cpp:371
371 return job > 200;
(gdb) bt
#0 Being::isMonster (this=0x79) at being.cpp:371
#1 0x080a93c1 in do_input () at game.cpp:598
#2 0x080a8641 in game () at game.cpp:140
#3 0x080b0302 in main (argc=1, argv=0x79) at main.cpp:396
(gdb) run
Starting program: /home/sull/tmw/tmwinstall/bin/tmw
Program received signal SIGSEGV, Segmentation fault.
Being::isMonster (this=0x87) at being.cpp:371
371 return job > 200;
(gdb) where
#0 Being::isMonster (this=0x87) at being.cpp:371
#1 0x080b59f4 in do_input () at game.cpp:598
#2 0x080ba451 in game () at game.cpp:140
#3 0x080be299 in main (argc=1, argv=0x87) at main.cpp:396
I fixed the specific crash Elven Programmer mentions, where the problem was attack() being called with any of 8 directions since recently while it was assuming only to be called with 4 directions.
I've just made sure the pointer is initialized to NULL now, but we should also either make sure to only call the function with 4 directions or fix the function to handle 8. Personally I think we shouldn't do diagonal attacking, as with 4 sprite directions were are unable to show it anyway.