]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.worn.c
2 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
6 static char rcsid
[] = "$NetBSD: hack.worn.c,v 1.3 1995/03/23 08:32:17 cgd Exp $";
29 register struct obj
*obj
;
32 register struct worn
*wp
;
33 register struct obj
*oobj
;
35 for(wp
= worn
; wp
->w_mask
; wp
++) if(wp
->w_mask
& mask
) {
37 if(oobj
&& !(oobj
->owornmask
& wp
->w_mask
))
38 impossible("Setworn: mask = %ld.", wp
->w_mask
);
39 if(oobj
) oobj
->owornmask
&= ~wp
->w_mask
;
40 if(obj
&& oobj
&& wp
->w_mask
== W_ARM
){
42 impossible("Setworn: uarm2 set?");
44 setworn(uarm
, W_ARM2
);
47 if(obj
) obj
->owornmask
|= wp
->w_mask
;
52 uarm
->owornmask
^= (W_ARM
| W_ARM2
);
56 /* called e.g. when obj is destroyed */
57 setnotworn(obj
) register struct obj
*obj
; {
58 register struct worn
*wp
;
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
);