Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
AhrefsBot, DotBot

Members: 0
Guests: 42
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » Modification for object progs.
Forum Rules | Mark all | Recent Posts

Modification for object progs.
< Newer Topic :: Older Topic > Might be a bug??

Pages:<< prev 1 next >>
Post is unread #1 Feb 2, 2007 1:28 am   Last edited Feb 2, 2007 12:34 pm by Anavel
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

 
Object progs that don't have a high success rate (anything other than 100) will not show any output when a player triggers it. Might be a bug; might not be. Depends on how you look at it.

In mud_prog.c find:

bool oprog_percent_check( CHAR_DATA * mob, CHAR_DATA * actor, OBJ_DATA * obj, void *vo, int type )
{
	MPROG_DATA *mprg;
	bool executed = FALSE;

	for ( mprg = obj->pIndexData->mudprogs; mprg; mprg = mprg->next )
		if ( mprg->type == type && ( number_percent(  ) <= atoi( mprg->arglist ) ) )
		{
			executed = TRUE;
			mprog_driver( mprg->comlist, mob, actor, obj, vo, FALSE );
			if ( type != GREET_PROG )
				break;
		}
	return executed;
}


And replace with:
bool oprog_percent_check( CHAR_DATA * mob, CHAR_DATA * actor, OBJ_DATA * obj, void *vo, int type )
{
	MPROG_DATA *mprg;
	bool executed = FALSE;

	for ( mprg = obj->pIndexData->mudprogs; mprg; mprg = mprg->next )
		if ( mprg->type == type && ( number_percent(  ) <= atoi( mprg->arglist ) ) )
		{
			executed = TRUE;
			mprog_driver( mprg->comlist, mob, actor, obj, vo, FALSE );
			if ( type != GREET_PROG )
				break;
		}
		else if ( type == PUSH_PROG || type == PULL_PROG )
			send_to_char( "Nothing happens...\n\r", actor );
	return executed;
}

Post is unread #2 Feb 2, 2007 1:56 am   
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

 
Won't this cause problems for programs that aren't explicitly triggered by players? I'm thinking e.g. of entry programs. You wouldn't want "Nothing happens..." printed to the player because an implicit program didn't make its roll.

Post is unread #3 Feb 2, 2007 12:32 pm   Last edited Feb 2, 2007 12:33 pm by Anavel
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

 
Yeah that could cause some issues. Thanks for pointing that out. :smile:

Pages:<< prev 1 next >>