Ok here the problem i get this error when i try to compile my mud:
act_comm.c: In function `do_teach':
act_comm.c:1220: warning: `vch' might be used uninitialized in this function
Code refers to this:
CHAR_DATA *vch;
and it is used here:
if( is_android( vch ) || is_superandroid( vch ) || is_bio( vch ) )
{
ch_printf(ch, "Androids can't learn this way.\n\r");
return;
}
It's not an error, it's a warning. It shouldn't prevent a compile.
Ok sry it wasnt because of that...
It was because of this
if( IS_NPC( vch ) )
{
ch_printf( ch, "Not on NPC's.\n\r" );
return;
}
But if i just ignore the warning and i use the skill it crashes the mud:/
Well, just like the warning says. The variable may not be uninitialized. Which means vch may be nothing. You have to define it.
right now its CHAR_DATA *vch;
Even when i put CHAR_DATA *vch = NULL; it crashes idk what to put instead of NULL
That's declaring it. You need to make vch something. Like, who it is. I don't know what you expect to do, so I can't really suggest what to do.
The command i created was do_teach
And all i want is if statement to do is check if its a computer (meaning not a player) and if it is a computer say not on npc's
vch is used also with the is_android(vch) and all that from earlier
You have any idea of what to put intead of NULL?
Yes, but you said "check if its...". I still don't know enough. What is "it"? Look over other functions like do_consider, maybe?