fix pull request #470 - two riding fixes

Post-3.6 change to monster inventory handling could result in hero
remaining mounted on an unsaddled steed (if saddle was removed via
opening magic).

Hero falling out of saddle would fall to the ground and take damage
even if levitating or flying without steed's help after dismount.

Fixes #470
This commit is contained in:
PatR
2021-03-16 11:01:43 -07:00
parent b3d21fd337
commit 0cca010ff1
4 changed files with 34 additions and 19 deletions

View File

@@ -1035,20 +1035,24 @@ racial_exception(struct monst *mon, struct obj *obj)
return 0;
}
/* Remove an object from a monster's inventory.
* At its core this is just obj_extract_self(), but it also handles any updates
* that needs to happen if the gear is equipped or in some other sort of state
* that needs handling.
* Note that like obj_extract_self(), this leaves obj free. */
/* Remove an object from a monster's inventory. */
void
extract_from_minvent(struct monst *mon, struct obj *obj,
boolean do_intrinsics, /* whether to call
update_mon_intrinsics */
boolean silently) /* doesn't affect all possible messages,
just update_mon_intrinsics's */
extract_from_minvent(
struct monst *mon,
struct obj *obj,
boolean do_intrinsics, /* whether to call update_mon_intrinsics */
boolean silently) /* doesn't affect all possible messages,
* just update_mon_intrinsics's */
{
long unwornmask = obj->owornmask;
/*
* At its core this is just obj_extract_self(), but it also handles
* any updates that need to happen if the gear is equipped or in
* some other sort of state that needs handling.
* Note that like obj_extract_self(), this leaves obj free.
*/
if (obj->where != OBJ_MINVENT) {
impossible("extract_from_minvent called on object not in minvent");
return;