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, DotBot

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
619
Alexander
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » 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 1, 2007, 11:28 pm   Last edited Feb 2, 2007, 10:34 am 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 1, 2007, 11:56 pm
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, 10:32 am   Last edited Feb 2, 2007, 10:33 am 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 >>