Register forum user name Search FAQ

Gammon Forum

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.
 Entire forum ➜ SMAUG ➜ Running the server ➜ Smaugfuss1.9.3

Smaugfuss1.9.3

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Oblisgr   (123 posts)  Bio
Date Wed 29 Jan 2020 12:02 AM (UTC)
Message
I added some line to do_wear and after that my game crashes when i m trying to wear a weapon.

it gives:


Wed Jan 29 01:55:15 2020 :: Oblisgr (127.0.0.1) has connected.
Segmentation fault (core dumped)


and the code i added is:



obj=get_obj_carry(ch, arg1);

   if ( (LEARNED(ch, gsn_daggers) < 1) && obj->value[3] == 0 )
   {
   send_to_char("You have to practice &B[daggers] weapon skill first.&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_swords) < 1) && obj->value[3] == 1 )
   {
   send_to_char("You are not studied &B[swords]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_greatswords) < 1) && obj->value[3] == 2 )
   {
   send_to_char("First you have to learn &B[greatswords]&D weapon proficiency.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_hatchets) < 1) && obj->value[3] == 3 )
   {
   send_to_char("You are not studied &B[hatchets]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_greataxes) < 1) && obj->value[3] == 4 )
   {
   send_to_char("You are not studied &B[greataxes]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_maces) < 1) && obj->value[3] == 5 )
   {
   send_to_char("You are not studied &B[maces]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_mauls) < 1) && obj->value[3] == 6 )
   {
   send_to_char("You are not studied &B[mauls]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_polearms) < 1) && obj->value[3] == 7 )
   {
   send_to_char("You are not studied &B[polearms]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_fists) < 1) && obj->value[3] == 8 )
   {
   send_to_char("You are not studied &B[fists]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_staves) < 1) && obj->value[3] == 9 )
   {
   send_to_char("You are not studied &B[staves]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_wands) < 1) && obj->value[3] == 10 )
   {
   send_to_char("You are not studied &B[wands]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_guns) < 1) && obj->value[3] == 11 )
   {
   send_to_char("You are not studied &B[guns]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_bows) < 1) && obj->value[3] == 12 )
   {
   send_to_char("You are not studied &B[bows]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_crossbows) < 1) && obj->value[3] == 13 )
   {
   send_to_char("You are not studied &B[crossbows]&D yet.\r\n", ch);
   return;
   } 

   if ( (LEARNED(ch, gsn_thrown) < 1) && obj->value[3] == 14 )
   {
   send_to_char("You are not studied &B[thrown]&D yet.\r\n", ch);
   return;
   } 

Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #1 on Wed 29 Jan 2020 05:49 AM (UTC)

Amended on Wed 29 Jan 2020 05:50 AM (UTC) by Fiendish

Message
Quote:
the code i added is

Code doesn't work that way. We need to know exactly where you put it and what all of the code around it is doing.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,121 posts)  Bio   Forum Administrator
Date Reply #2 on Wed 29 Jan 2020 05:58 AM (UTC)
Message
I suggest you look at: http://gammon.com.au/gdb

It will be worth getting gdb to work for you, and then you can find the exact line where it crashed. That won't necessarily tell you the exact reason for the crash, but it will put you in the right general spot.

My guess is that 'obj' or 'ch' are NULL, but the reason for that you would have to find out.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Oblisgr   (123 posts)  Bio
Date Reply #3 on Wed 29 Jan 2020 06:34 PM (UTC)
Message
problem solved!

changed position to obj=get_obj_carry(ch, arg1);
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.


13,441 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.