[Enh] Allow Coded exceptions to be passed through the bestow command
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Sep 6, 2008 3:43 am
Last edited Sep 6, 2008 3:51 am by Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006
Enhancement: Allow for Exceptions to be passed through bestow for special privileges.
Purpose: Allows coded exceptions to be passed through the bestow function properly so that special privileges like the ability to modify prototype flags below the sysdata level can be given to trusted individuals.
Provided by: Kayle
Applies to: SmaugFUSS
---
act_wiz.c
Function: void do_bestow( CHAR_DATA* ch, const char* argument)
At the top of the function, find:
Below that, add:
Further down, inside the while loop change it to look like:
clans.c
Function: void do_induct( CHAR_DATA* ch, const char* argument)
Change:
to
Function: void do_outcast( CHAR_DATA* ch, const char* argument)
Change:
to
Purpose: Allows coded exceptions to be passed through the bestow function properly so that special privileges like the ability to modify prototype flags below the sysdata level can be given to trusted individuals.
Provided by: Kayle
Applies to: SmaugFUSS
---
act_wiz.c
Function: void do_bestow( CHAR_DATA* ch, const char* argument)
At the top of the function, find:
bool fComm = FALSE;
Below that, add:
const char *const bestow_exceptions[] = { "protoflag", "caninduct", "canoutcast" };
Further down, inside the while loop change it to look like:
while( arg[0] != '\0' ) { const char *cmd_buf; char cmd_tmp[MAX_INPUT_LENGTH]; short numExceptions = ( sizeof( bestow_exceptions ) / sizeof( bestow_exceptions[0] ) ); bool cFound = FALSE, isException = FALSE; if( get_trust( ch ) < LEVEL_GREATER ) { for( int count = 0; count < numExceptions; count++ ) { if( !str_cmp( arg, bestow_exceptions[count] ) ) { isException = TRUE; break; } } } if( !isException && !( cmd = find_command( arg ) ) ) { ch_printf( ch, "No such command as %s!\r\n", arg ); argument = one_argument( argument, arg ); continue; } else if( !isException && cmd->level > get_trust( ch ) ) { ch_printf( ch, "You can't bestow the %s command!\r\n", arg ); argument = one_argument( argument, arg ); continue; }
clans.c
Function: void do_induct( CHAR_DATA* ch, const char* argument)
Change:
if( ( ch->pcdata && ch->pcdata->bestowments && is_name( "induct", ch->pcdata->bestowments ) ) || !str_cmp( ch->name, clan->deity ) || !str_cmp( ch->name, clan->leader ) || !str_cmp( ch->name, clan->number1 ) || !str_cmp( ch->name, clan->number2 ) ) ; else
to
if( ( ch->pcdata && ch->pcdata->bestowments && is_name( "caninduct", ch->pcdata->bestowments ) ) || !str_cmp( ch->name, clan->deity ) || !str_cmp( ch->name, clan->leader ) || !str_cmp( ch->name, clan->number1 ) || !str_cmp( ch->name, clan->number2 ) ) ; else
Function: void do_outcast( CHAR_DATA* ch, const char* argument)
Change:
if( ( ch->pcdata && ch->pcdata->bestowments && is_name( "outcast", ch->pcdata->bestowments ) ) || !str_cmp( ch->name, clan->deity ) || !str_cmp( ch->name, clan->leader ) || !str_cmp( ch->name, clan->number1 ) || !str_cmp( ch->name, clan->number2 ) ) ; else
to
if( ( ch->pcdata && ch->pcdata->bestowments && is_name( "canoutcast", ch->pcdata->bestowments ) ) || !str_cmp( ch->name, clan->deity ) || !str_cmp( ch->name, clan->leader ) || !str_cmp( ch->name, clan->number1 ) || !str_cmp( ch->name, clan->number2 ) ) ; else
Pages:<< prev 1 next >>