X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fitem_key.qc;h=e939a5faac4196a2378ef7111a1523f04e4dae70;hb=b2e3660c5c919d8be9594934e8f6eec9b82346a3;hp=d33fe87c2e1a477189000119b501b52c6f69c88e;hpb=268f9c69576b6bb929f66d19f0d077d19ba47edd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index d33fe87c2..e939a5faa 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -1,6 +1,7 @@ #include "item_key.qh" -#include "../common/triggers/subs.qh" +#include "../common/mapobjects/subs.qh" +#include #include "../common/monsters/_mod.qh" #include "../common/notifications/all.qh" #include "../common/util.qh" @@ -17,10 +18,10 @@ TODO: 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 @@ -74,10 +75,10 @@ void item_key_touch(entity this, entity toucher) 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);