if(!IS_PLAYER(player))
return false;
- int valid = (door.itemkeys & player.itemkeys);
+ entity store = player;
+#ifdef SVQC
+ store = PS(player);
+#endif
+ int valid = (door.itemkeys & store.itemkeys);
door.itemkeys &= ~valid; // only some of the needed keys were given
if(!door.itemkeys)
#ifdef CSQC
bool item_keys_usekey(entity l, entity p)
{
- int valid = (l.itemkeys & p.itemkeys);
+ int valid = (l.itemkeys & p.itemkeys); // TODO: itemkeys isn't networked or anything!
l.itemkeys &= ~valid; // only some of the needed keys were given
return valid != 0;
}
// custom
ATTRIB(Player, dual_weapons, vector, this.dual_weapons); // TODO: actually WepSet!
+ ATTRIB(Player, itemkeys, int, this.itemkeys);
INIT(Player) {
this.classname = STR_PLAYER;
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);