Menu

#883 Monsters will not apply weapons in their inventory

2.x
closed
nobody
server (385)
5
2021-02-27
2020-11-23
No

I think I traced the issue to apply.c function apply_can_apply_object, and probably around line 1042:

} else if (who->body_used[i]+op->body_info[i] < 0) {

In case of a monster applying eg a sword, "body_used" will be 0, and "body_info" -1.

"get_item_from_body_location" will return NULL (no weapon equipped), so retval will be flagged with CAN_APPLY_NEVER (line 1066), which is wrong.

Changing line 1042 apparently leads to other fun things like player getting "you don't have the body to use a sword" when a double-handed sword is used (but the sword is correctly applied anyway...).

So some analysis is needed to figure the exact issue and code flow.

Discussion

  • Nicolas Weeger

    Nicolas Weeger - 2020-12-13
    • status: open --> patched
     
  • Nicolas Weeger

    Nicolas Weeger - 2020-12-13

    Should be fixed with r21608.

     
  • Nicolas Weeger

    Nicolas Weeger - 2021-02-27
    • status: patched --> closed
     

Log in to post a comment.