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 $ */
4 /* $DragonFly: src/games/hack/hack.worn.c,v 1.2 2003/06/17 04:25:24 dillon Exp $ */
32 for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) {
34 if(oobj && !(oobj->owornmask & wp->w_mask))
35 impossible("Setworn: mask = %ld.", wp->w_mask);
36 if(oobj) oobj->owornmask &= ~wp->w_mask;
37 if(obj && oobj && wp->w_mask == W_ARM){
39 impossible("Setworn: uarm2 set?");
41 setworn(uarm, W_ARM2);
44 if(obj) obj->owornmask |= wp->w_mask;
49 uarm->owornmask ^= (W_ARM | W_ARM2);
53 /* called e.g. when obj is destroyed */
54 setnotworn(obj) struct obj *obj; {
57 for(wp = worn; wp->w_mask; wp++)
58 if(obj == *(wp->w_obj)) {
60 obj->owornmask &= ~wp->w_mask;
65 uarm->owornmask ^= (W_ARM | W_ARM2);