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, Bing, Yandex, Yahoo!

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
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 >>