[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Running the server
. . -> [Subject]  Smaugfuss1.9.3

Smaugfuss1.9.3

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


Posted by Oblisgr   (123 posts)  [Biography] 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;
   } 

[Go to top] top

Posted by Fiendish   USA  (2,525 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (23,017 posts)  [Biography] 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
[Go to top] top

Posted by Oblisgr   (123 posts)  [Biography] 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);
[Go to top] 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.


12,487 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]