Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix early mech dismount leaving you armed #2781

Merged
merged 3 commits into from
May 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -994,13 +994,16 @@ void Character::mount_creature( monster &z )
guy.setpos( pnt );
}
z.facing = facing;
add_msg_if_player( m_good, _( "You climb on the %s." ), z.get_name() );
if( z.has_flag( MF_RIDEABLE_MECH ) ) {
if( !z.type->mech_weapon.is_empty() ) {
item mechwep = item( z.type->mech_weapon );
wield( mechwep );
// Make sure something didn't interrupt this process and knock the player off partway through!
if( has_effect( effect_riding ) ) {
add_msg_if_player( m_good, _( "You climb on the %s." ), z.get_name() );
if( z.has_flag( MF_RIDEABLE_MECH ) ) {
if( !z.type->mech_weapon.is_empty() ) {
auto mechwep = item{ z.type->mech_weapon };
wield( mechwep );
}
add_msg_if_player( m_good, _( "You hear your %s whir to life." ), z.get_name() );
}
add_msg_if_player( m_good, _( "You hear your %s whir to life." ), z.get_name() );
}
// some rideable mechs have night-vision
recalc_sight_limits();
Expand Down