I have recently just converted my SWFotE 2.0 base to C++. It compiles and runs smoothly except for a crash when a player looks in the same room as another player. If I comment out the function call in question, the MUD will run just fine.
Where it calls show_char_to_char, list and ch point to character "Drozel". So somewhere between the call and the function, something happens to ch. However, if I were to convert this code back to regular C, then it compiles and runs fine. Any ideas? Need more information?
When you say "converted" to C++, I assume you mean "made able to compile with a C++ compiler", since nothing in the above code snippets is C++ specific in any way?
Does it crash on the first iteration of the loop, or after it's done "stuff" to the structures in question? Since ch->name is out of bounds, but rch is cannot access, perhaps you changed a struct to a class somewhere, and forgot to change the visibility to public? If I remember right, C++ treats all members of a struct as public, but a class defaults to private.
I'd suggest waking up the stack and seeing if ch is still valid in the frame before show_char_to_char, so you know if something was changed as you walked the list, or if it was a local variable that got moved.
The offending section of code is:
Some GDB output:
Where it calls show_char_to_char, list and ch point to character "Drozel". So somewhere between the call and the function, something happens to ch. However, if I were to convert this code back to regular C, then it compiles and runs fine. Any ideas? Need more information?