]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.worn.c
bfec47f21996630e01924378a9487fa53f8945f0
1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.worn.c - version 1.0.2 */
24 register struct obj
*obj
;
27 register struct worn
*wp
;
28 register struct obj
*oobj
;
30 for(wp
= worn
; wp
->w_mask
; wp
++) if(wp
->w_mask
& mask
) {
32 if(oobj
&& !(oobj
->owornmask
& wp
->w_mask
))
33 impossible("Setworn: mask = %ld.", wp
->w_mask
);
34 if(oobj
) oobj
->owornmask
&= ~wp
->w_mask
;
35 if(obj
&& oobj
&& wp
->w_mask
== W_ARM
){
37 impossible("Setworn: uarm2 set?");
39 setworn(uarm
, W_ARM2
);
42 if(obj
) obj
->owornmask
|= wp
->w_mask
;
47 uarm
->owornmask
^= (W_ARM
| W_ARM2
);
51 /* called e.g. when obj is destroyed */
52 setnotworn(obj
) register struct obj
*obj
; {
53 register struct worn
*wp
;
55 for(wp
= worn
; wp
->w_mask
; wp
++)
56 if(obj
== *(wp
->w_obj
)) {
58 obj
->owornmask
&= ~wp
->w_mask
;
63 uarm
->owornmask
^= (W_ARM
| W_ARM2
);