Login
User Name:

Password:



Register

Forgot your password?
void nanny_get_new_race -- comm.c
Mar 13, 2025 7:08 am
By Elwood
IPv6
Jan 25, 2025 10:45 pm
By Samson
mudstrlcpy and mudstrlcat
Jan 18, 2025 5:23 pm
By Samson
I3 and IMC
Jan 17, 2025 9:35 pm
By Samson
AFKMud 2.5.1
Jan 17, 2025 2:22 pm
By Samson
SWFotEFUSS 1.5.3
Author: Various
Submitted by: Samson
SWRFUSS 1.4.3
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.8
Author: Various
Submitted by: Samson
AFKMud 2.5.2
Author: AFKMud Team
Submitted by: Samson
SmaugFUSS 1.9.7
Author: Various
Submitted by: Samson
Users Online
Anthropic, Yandex, Bing, DotBot

Members: 0
Guests: 5
Stats
Files
Topics
Posts
Members
Newest Member
507
3,812
19,723
594
Bardecome

» 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
Fledgling
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
Posts902
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
Fledgling
GroupMembers
Posts24
JoinedMar 6, 2005

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

Pages:<< prev 1 next >>