Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, Google

Members: 0
Guests: 19
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
621
KellieBusb
Today's Birthdays
Rane (42)
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 >>