MCPcopy Index your code
hub / github.com/NetHack/NetHack / addinv_before

Function addinv_before

src/invent.c:1159–1165  ·  view source on GitHub ↗

add obj to the hero's inventory by inserting in front of a specific item; used for throw-and-return in case '!fixinv' is in effect */

Source from the content-addressed store, hash-verified

1157/* add obj to the hero's inventory by inserting in front of a specific item;
1158 used for throw-and-return in case '!fixinv' is in effect */
1159struct obj *
1160addinv_before(
1161 struct obj *obj, struct obj *other_obj)
1162{
1163 /* if 'other_obj' is present this will implicitly be 'nomerge' */
1164 return addinv_core0(obj, other_obj, TRUE);
1165}
1166
1167/* return value will always be 'obj' */
1168struct obj *

Callers 2

throwitFunction · 0.85
return_throw_to_invFunction · 0.85

Calls 1

addinv_core0Function · 0.85

Tested by

no test coverage detected