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
➜ Simple question...I think!
Simple question...I think!
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Jmont
(4 posts) Bio
|
Date
| Wed 05 Aug 2009 12:19 AM (UTC) |
Message
| Alright I'm trying to get rid of carrying weight. So I have been getting rid of any instance of can_carry_w like so...
if( char_died( ch )
||ch->carry_number >= can_carry_n( ch )
|| ch->carry_weight >= can_carry_w( ch ) || ( number && cnt >= number ) )
{
if( IS_SET( sysdata.save_flags, SV_GET ) && !char_died( ch ) )
save_char_obj( ch );
return;
Now when I delete this line
|| ch->carry_weight >= can_carry_w( ch ) || ( number && cnt >= number ) )
I get this error
Compiling o/act_obj.o....
act_obj.c: In function `void do_get(CHAR_DATA*, const char*)':
act_obj.c:300: error: expected `)' before '{' token
act_obj.c:305: error: expected primary-expression before '}' token
act_obj.c:305: error: expected `;' before '}' token
But I if I add the line back in then everything is all OK. I'm sure I'm missing something simple here but I'm lost for words. If anyone can explain to me whats wrong, or even point me to a tutorial related to my error that would be awesome...I am eager to learn and create.
Thanks everyone!
| Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Wed 05 Aug 2009 12:50 AM (UTC) |
Message
| You're deleting too many parenthesis, as the error says. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Jmont
(4 posts) Bio
|
Date
| Reply #2 on Wed 05 Aug 2009 12:55 AM (UTC) |
Message
| Hrm but it doesn't look like I need any parenthesis. Unless I'm wrong, which I have to be if I getting errors.
if( char_died( ch )
||ch->carry_number >= can_carry_n( ch )
{
if( IS_SET( sysdata.save_flags, SV_GET ) && !char_died( ch ) )
save_char_obj( ch );
return;
}
}
}
This is what it looks like when I take that line out. I don't really see what needs a parenthesis though ;_; Also what does the || mean?! It's been awhile since I took any programming classes.
Thanks Zeno | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #3 on Wed 05 Aug 2009 12:56 AM (UTC) |
Message
| The parenthesis before char_died is where you're missing the matching parenthesis.
|| is an or. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Jmont
(4 posts) Bio
|
Date
| Reply #4 on Wed 05 Aug 2009 12:58 AM (UTC) |
Message
| Yeah I just noticed the missing parenthesis I didn't know it was one big IF statement. OK one last questions and I should be done with this one, what exactly Is this IF statement saying and doing?
Thanks again Zeno :D | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #5 on Wed 05 Aug 2009 01:29 AM (UTC) Amended on Wed 05 Aug 2009 01:30 AM (UTC) by Zeno
|
Message
| IF char has died OR char is carrying equal or greater than their max number of items OR char is carrying equal OR greater than their max weight OR ???, THEN IF the config is on for saving on get AND the char hasn't died, THEN save the char.
I don't know what the ??? is because I don't know what number or cnt is. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Jmont
(4 posts) Bio
|
Date
| Reply #6 on Wed 05 Aug 2009 01:37 AM (UTC) |
Message
| This might be sound dumb but I thought saving was taken care of somewhere else? Is this just to make sure you don't get an item and lose it? | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #7 on Wed 05 Aug 2009 01:55 AM (UTC) |
Message
| Saving happens in many places. In this case, it is to save your char when you pick up an item. |
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.
21,359 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top