Bug: Auto-Exits don't check position before moving character.
Danger: Medium - Players can move through auto-exits regardless of their position
Found by: Banner
Fixed by: Sharmair/Kayle
---
Interp.c, interpret
Find:
{
EXIT_DATA *pexit;
/*
* check for an auto-matic exit command
*/
if( ( pexit = find_door( ch, command, TRUE ) ) != NULL && IS_SET( pexit->exit_info, EX_xAUTO ) )
{
if( IS_SET( pexit->exit_info, EX_CLOSED )
&& ( !IS_AFFECTED( ch, AFF_PASS_DOOR ) || IS_SET( pexit->exit_info, EX_NOPASSDOOR ) ) )
{
if( !IS_SET( pexit->exit_info, EX_SECRET ) )
act( AT_PLAIN, "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR );
else
send_to_char( "You cannot do that here.\r\n", ch );
return;
}
move_char( ch, pexit, 0 );
return;
}
if( rprog_custom_trigger( command, argument, ch ) )
return;
if( mprog_custom_trigger( command, argument, ch ) )
return;
if( oprog_custom_trigger( command, argument, ch ) )
return;
send_to_char( "Huh?\r\n", ch );
}
Change to:
{
EXIT_DATA *pexit;
/*
* check for an auto-matic exit command
*/
if( ( pexit = find_door( ch, command, TRUE ) ) != NULL && IS_SET( pexit->exit_info, EX_xAUTO ) )
{
if( IS_SET( pexit->exit_info, EX_CLOSED )
&& ( !IS_AFFECTED( ch, AFF_PASS_DOOR ) || IS_SET( pexit->exit_info, EX_NOPASSDOOR ) ) )
{
if( !IS_SET( pexit->exit_info, EX_SECRET ) )
act( AT_PLAIN, "The $d is closed.", ch, NULL, pexit->keyword, TO_CHAR );
else
send_to_char( "You cannot do that here.\r\n", ch );
return;
}
if( check_pos( ch, POS_STANDING ) )
move_char( ch, pexit, 0 );
return;
}
if( rprog_custom_trigger( command, argument, ch ) )
return;
if( mprog_custom_trigger( command, argument, ch ) )
return;
if( oprog_custom_trigger( command, argument, ch ) )
return;
send_to_char( "Huh?\r\n", ch );
}
Auto-Exits were not taking position into account before moving characters, so they could get around while asleep using autoexits if they wanted.