Unify putting a saddle on steed
This commit is contained in:
23
src/steed.c
23
src/steed.c
@@ -134,18 +134,27 @@ struct obj *otmp;
|
||||
if (otmp->owornmask)
|
||||
remove_worn_item(otmp, FALSE);
|
||||
freeinv(otmp);
|
||||
/* mpickobj may free otmp it if merges, but we have already
|
||||
checked for a saddle above, so no merger should happen */
|
||||
(void) mpickobj(mtmp, otmp);
|
||||
mtmp->misc_worn_check |= W_SADDLE;
|
||||
otmp->owornmask = W_SADDLE;
|
||||
otmp->leashmon = mtmp->m_id;
|
||||
update_mon_intrinsics(mtmp, otmp, TRUE, FALSE);
|
||||
put_saddle_on_mon(otmp, mtmp);
|
||||
} else
|
||||
pline("%s resists!", Monnam(mtmp));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
put_saddle_on_mon(saddle, mtmp)
|
||||
struct obj *saddle;
|
||||
struct monst *mtmp;
|
||||
{
|
||||
if (!can_saddle(mtmp) || which_armor(mtmp, W_SADDLE))
|
||||
return;
|
||||
if (mpickobj(mtmp, saddle))
|
||||
panic("merged saddle?");
|
||||
mtmp->misc_worn_check |= W_SADDLE;
|
||||
saddle->owornmask = W_SADDLE;
|
||||
saddle->leashmon = mtmp->m_id;
|
||||
update_mon_intrinsics(mtmp, saddle, TRUE, FALSE);
|
||||
}
|
||||
|
||||
/*** Riding the monster ***/
|
||||
|
||||
/* Can we ride this monster? Caller should also check can_saddle() */
|
||||
|
||||
Reference in New Issue
Block a user