Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Anyone wanna help?
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Zunit1920
(10 posts) Bio
|
| Date
| Tue 13 Dec 2005 10:12 PM (UTC) |
| Message
| 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;
} | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #1 on Tue 13 Dec 2005 10:21 PM (UTC) |
| Message
| | It's not an error, it's a warning. It shouldn't prevent a compile. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Zunit1920
(10 posts) Bio
|
| Date
| Reply #2 on Tue 13 Dec 2005 10:37 PM (UTC) |
| Message
| 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:/ | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #3 on Tue 13 Dec 2005 10:41 PM (UTC) |
| Message
| | Well, just like the warning says. The variable may not be uninitialized. Which means vch may be nothing. You have to define it. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Zunit1920
(10 posts) Bio
|
| Date
| Reply #4 on Tue 13 Dec 2005 10:42 PM (UTC) |
| Message
| right now its CHAR_DATA *vch;
Even when i put CHAR_DATA *vch = NULL; it crashes idk what to put instead of NULL | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #5 on Tue 13 Dec 2005 10:43 PM (UTC) |
| Message
| | 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. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
| Posted by
| Zunit1920
(10 posts) Bio
|
| Date
| Reply #6 on Tue 13 Dec 2005 11:07 PM (UTC) Amended on Tue 13 Dec 2005 11:08 PM (UTC) by Zunit1920
|
| Message
| 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? | | Top |
|
| Posted by
| Zeno
USA (2,871 posts) Bio
|
| Date
| Reply #7 on Tue 13 Dec 2005 11:23 PM (UTC) |
| Message
| | Yes, but you said "check if its...". I still don't know enough. What is "it"? Look over other functions like do_consider, maybe? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
23,366 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top