1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.worn.c - version 1.0.2 */
3 /* $FreeBSD: src/games/hack/hack.worn.c,v 1.3 1999/11/16 02:57:14 billf Exp $ */
25 setworn(struct obj
*obj
, long mask
)
30 for (wp
= worn
; wp
->w_mask
; wp
++)
31 if (wp
->w_mask
& mask
) {
33 if (oobj
&& !(oobj
->owornmask
& wp
->w_mask
))
34 impossible("Setworn: mask = %ld.", wp
->w_mask
);
36 oobj
->owornmask
&= ~wp
->w_mask
;
37 if (obj
&& oobj
&& wp
->w_mask
== W_ARM
) {
39 impossible("Setworn: uarm2 set?");
41 setworn(uarm
, W_ARM2
);
45 obj
->owornmask
|= wp
->w_mask
;
50 uarm
->owornmask
^= (W_ARM
| W_ARM2
);
54 /* called e.g. when obj is destroyed */
56 setnotworn(struct obj
*obj
)
60 for (wp
= worn
; wp
->w_mask
; wp
++)
61 if (obj
== *(wp
->w_obj
)) {
63 obj
->owornmask
&= ~wp
->w_mask
;
68 uarm
->owornmask
^= (W_ARM
| W_ARM2
);