konijn_
December 4, 2009, 00:40
In my usual passive aggresive way I smack down in one thread and humbly ask for help in another :D
So,
/* Check for entering a dungeon */
if ((p_ptr->visits & (0x1 << dun_level)) == 0)
{
const char *msg = NULL;
if (dun_level == 0)
msg = "You enter the sewers of Volterra.";
else if (dun_level == 1)
msg = "You descend into the lower levels of Hell.";
else if (dun_level == 10)
msg = "You descend into the circle of the Heretics."
...
msg_print(msg);;
Could this code crash at any moment ? I seem to be putting a string in a pointer that points to one char only ?? What would be the proper way of doing this without jumping through hoops to make the msg_print work ?
T.
So,
/* Check for entering a dungeon */
if ((p_ptr->visits & (0x1 << dun_level)) == 0)
{
const char *msg = NULL;
if (dun_level == 0)
msg = "You enter the sewers of Volterra.";
else if (dun_level == 1)
msg = "You descend into the lower levels of Hell.";
else if (dun_level == 10)
msg = "You descend into the circle of the Heretics."
...
msg_print(msg);;
Could this code crash at any moment ? I seem to be putting a string in a pointer that points to one char only ?? What would be the proper way of doing this without jumping through hoops to make the msg_print work ?
T.