Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Bing, Yahoo!

Members: 0
Guests: 16
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
613
bastian
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » BugFix: can_see_obj (crash bu...
Forum Rules | Mark all | Recent Posts

BugFix: can_see_obj (crash bug)
< Newer Topic :: Older Topic > Didn't see it in the patch...

Pages:<< prev 1 next >>
Post is unread #1 Jan 3, 2004, 12:39 pm   Last edited Nov 24, 2007, 12:13 am by Samson
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Hey folks!

I've noticed that there are cases where a social targetting an object will crash the MUD. I've found one of the causes (might be the only one)

In handler.c, around line 3049 is bool can_see_obj.
In the top of that function, add the following:

   if( !ch )
   {
      bug( "%s: null ch!", __FUNCTION__ );
      return FALSE;
   }

   if( !obj )
      return FALSE;


The first bit with the ch check is just because I'm paranoid.
The second bit will stop that from crashing the MUD.

-- X
       
Post is unread #2 Jan 3, 2004, 1:08 pm
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Small edit. Idiot me forgot to put 'return FALSE;' in the first half. Instead it was just 'return;'

-- X
       
Post is unread #3 Jan 3, 2004, 4:41 pm   Last edited Nov 24, 2007, 12:13 am by Samson
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Follow up:

Stopped the crashing. While the above fix is worth it anyway, try this:

In comm.c, function 'act_string'...

change
      case 'p': i = (!to || can_see_obj(to, obj1, FALSE) ? obj_short(obj1) : "something";);         break;
      case 'P': i = (!to || can_see_obj(to, obj2, FALSE) ? obj_short(obj2) : "something";);         break;


To

      case 'p': i = (!obj1 ? "" : (!to || can_see_obj(to, obj1, FALSE) ? obj_short(obj1) : "something";) );         break;
      case 'P': i = (!obj2 ? "" : (!to || can_see_obj(to, obj2, FALSE) ? obj_short(obj2) : "something";) );         break;


-- X
       
Pages:<< prev 1 next >>