#include "item_key.qh"
-#include "../common/triggers/subs.qh"
+#include "../common/mapobjects/subs.qh"
+#include <common/mapobjects/triggers.qh>
#include "../common/monsters/_mod.qh"
#include "../common/notifications/all.qh"
#include "../common/util.qh"
bool item_keys_usekey(entity l, entity p)
{
- float valid = l.itemkeys & p.itemkeys;
+ int valid = l.itemkeys & PS(p).itemkeys;
if (!valid) {
- // other has none of the needed keys
+ // player has none of the needed keys
return false;
} else if (l.itemkeys == valid) {
// ALL needed keys were given
return;
// player already picked up this key
- if (toucher.itemkeys & this.itemkeys)
+ if (PS(toucher).itemkeys & this.itemkeys)
return;
- toucher.itemkeys |= this.itemkeys;
+ PS(toucher).itemkeys |= this.itemkeys;
play2(toucher, this.noise);
centerprint(toucher, this.message);
this.message = "";
SUB_UseTargets(this, toucher, toucher); // TODO: should we be using toucher for the trigger here?
this.message = oldmsg;
-};
+}
/**
* Spawn a key with given model, key code and color.
}
settouch(this, item_key_touch);
-};
+}
/*QUAKED item_key (0 .5 .8) (-16 -16 -24) (16 16 32) FLOATING
this.classname = "item_key";
this.itemkeys = ITEM_KEY_BIT(1);
spawnfunc_item_key(this);
-};
+}
/*QUAKED item_key2 (0 .5 .8) (-16 -16 -24) (16 16 32) FLOATING
GOLD key.
this.classname = "item_key";
this.itemkeys = ITEM_KEY_BIT(0);
spawnfunc_item_key(this);
-};
+}