Pages:<< prev 1 next >>



Conjurer

GroupMembers
Posts429
JoinedMar 7, 2005
Another day, another long-standing but likely never noticed bug. I suspect this is a combination of confusion on the flag names and the fact that I have yet to see anyone actually use either EX_CLIMB or EX_xCLIMB.
Basically, only EX_xCLIMB was in place in the stock code. The result, embarrassingly, was that if climbing up was required to leave a room and you typed "climb up", say, you would get a message indicating that "you cannot climb there."
The observant may point that, yes, simply typing "up" will work and employ the climb skill (assuming you have it) but obviously it should still work to type "climb up" instead. To my understanding, EX_CLIMB means you must climb (or fly) in that exit direction, whereas EX_xCLIMB means you can use the climb command, but it is not necessary, nor is the climbing skill.
In any case, find this in act_move.c:
The fix is probably fairly obvious, just add the second climb flag into the mix:
And that's that.
Basically, only EX_xCLIMB was in place in the stock code. The result, embarrassingly, was that if climbing up was required to leave a room and you typed "climb up", say, you would get a message indicating that "you cannot climb there."

The observant may point that, yes, simply typing "up" will work and employ the climb skill (assuming you have it) but obviously it should still work to type "climb up" instead. To my understanding, EX_CLIMB means you must climb (or fly) in that exit direction, whereas EX_xCLIMB means you can use the climb command, but it is not necessary, nor is the climbing skill.
In any case, find this in act_move.c:
void do_climb( CHAR_DATA* ch, const char* argument) { EXIT_DATA *pexit; if( argument[0] == '\0' ) { for( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next ) if( IS_SET( pexit->exit_info, EX_xCLIMB ) ) { move_char( ch, pexit, 0 ); return; } send_to_char( "You cannot climb here.\r\n", ch ); return; } if( ( pexit = find_door( ch, argument, TRUE ) ) != NULL && IS_SET( pexit->exit_info, EX_xCLIMB ) ) { move_char( ch, pexit, 0 ); return; } send_to_char( "You cannot climb there.\r\n", ch ); return; }
The fix is probably fairly obvious, just add the second climb flag into the mix:
void do_climb( CHAR_DATA* ch, const char* argument) { EXIT_DATA *pexit; if( argument[0] == '\0' ) { for( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next ) if( IS_SET( pexit->exit_info, EX_xCLIMB ) || IS_SET( pexit->exit_info, EX_CLIMB ) ) { move_char( ch, pexit, 0 ); return; } send_to_char( "You cannot climb here.\r\n", ch ); return; } if ( (pexit = find_door( ch, argument, TRUE )) != NULL && ( IS_SET( pexit->exit_info, EX_xCLIMB ) || IS_SET( pexit->exit_info, EX_CLIMB ) ) ) { move_char( ch, pexit, 0 ); return; } send_to_char( "You cannot climb there.\r\n", ch ); return; }
And that's that.



Apprentice

GroupMembers
Posts78
JoinedAug 28, 2016
Nice eye. I'd like to add if they are climbing, and there is a climb skill... they should learn something. so I fixed mine with adding this...
void do_climb( CHAR_DATA* ch, const char* argument) { EXIT_DATA *pexit; if( argument[0] == '\0' ) { for( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next ) if( IS_SET( pexit->exit_info, EX_xCLIMB ) || IS_SET( pexit->exit_info, EX_CLIMB ) ) { send_to_char( "You begin to climb.\r\n", ch); learn_from_success( ch, gsn_climb ); move_char( ch, pexit, 0 ); return; } send_to_char( "You cannot climb here.\r\n", ch ); return; } if( ( pexit = find_door( ch, argument, TRUE ) ) != NULL && ( IS_SET( pexit->exit_info, EX_xCLIMB ) || IS_SET( pexit->exit_info, EX_CLIMB ) ) ) { send_to_char( "You begin to climb.\r\n", ch); learn_from_success( ch, gsn_climb ); move_char( ch, pexit, 0 ); return; } send_to_char( "You cannot climb there.\r\n", ch ); return; }



Conjurer

GroupMembers
Posts429
JoinedMar 7, 2005
Believe that's already accounted for in move_char( ), and they shouldn't be learning climbing skill just because they climbed where it was not strictly necessary (EX_xCLIMB), but to each his own. Just make sure you're not double whammying them and doing learn_from_success( ) twice due to move_char( ) picking up on it. I assumed that's why the Devs left it out of this function to begin with.




Apprentice

GroupMembers
Posts78
JoinedAug 28, 2016
actually I forgot I had modified how gain_from works on my base over stock... so yeah... don't do what I did

Pages:<< prev 1 next >>