]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/item_key.qc
Merge branch 'master' into TimePath/effectinfo
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / item_key.qc
index a130b826c2ce46f3a918e637b56d50bd780a350a..780607871fe96173d15cab6759579deae08c86db 100644 (file)
@@ -1,16 +1,11 @@
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-       #include "../dpdefs/progsdefs.qh"
-    #include "../dpdefs/dpextensions.qh"
-    #include "../warpzonelib/util_server.qh"
-    #include "../common/util.qh"
-    #include "../common/monsters/monsters.qh"
-       #include "../common/triggers/subs.qh"
-    #include "defs.qh"
-    #include "../common/notifications.qh"
-    #include "item_key.qh"
-#endif
+#include "item_key.qh"
+#include "_all.qh"
+
+#include "../common/triggers/subs.qh"
+#include "../common/monsters/all.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+#include "../warpzonelib/util_server.qh"
 
 /*
 TODO:
@@ -40,9 +35,6 @@ bool item_keys_usekey(entity l, entity p)
 }
 
 string item_keys_keylist(float keylist) {
-       float base, l;
-       string n;
-
        // no keys
        if (!keylist)
                return "";
@@ -51,10 +43,10 @@ string item_keys_keylist(float keylist) {
        if ((keylist & (keylist-1)) != 0)
                return strcat("the ", item_keys_names[lowestbit(keylist)]);
 
-       n = "";
-       base = 0;
+       string n = "";
+       int base = 0;
        while (keylist) {
-               l = lowestbit(keylist);
+               int l = lowestbit(keylist);
                if (n)
                        n = strcat(n, ", the ", item_keys_names[base + l]);
                else
@@ -77,7 +69,8 @@ item_key
 /**
  * Key touch handler.
  */
-void item_key_touch(void) {
+void item_key_touch()
+{SELFPARAM();
        if (!IS_PLAYER(other))
                return;
 
@@ -94,7 +87,8 @@ void item_key_touch(void) {
 /**
  * Spawn a key with given model, key code and color.
  */
-void spawn_item_key() {
+void spawn_item_key()
+{SELFPARAM();
        precache_model(self.model);
 
        if (self.spawnflags & 1) // FLOATING
@@ -109,7 +103,7 @@ void spawn_item_key() {
 
        self.mdl = self.model;
        self.effects = EF_LOWPRECISION;
-       setmodel(self, self.model);
+       _setmodel(self, self.model);
        //setsize(self, '-16 -16 -24', '16 16 32');
        setorigin(self, self.origin + '0 0 32');
        setsize(self, '-16 -16 -56', '16 16 0');
@@ -154,7 +148,8 @@ This is the only correct way to put keys on the map!
 
 itemkeys MUST always have exactly one bit set.
 */
-void spawnfunc_item_key() {
+void spawnfunc_item_key()
+{SELFPARAM();
        string _netname;
        vector _colormod;
 
@@ -239,7 +234,7 @@ void spawnfunc_item_key() {
                self.message = strzone(strcat("You've picked up the ", self.netname, "!"));
 
        if (self.noise == "")
-               self.noise = "misc/itempickup.wav";
+               self.noise = SND(ITEMPICKUP);
 
        // save the name for later
        item_keys_names[lowestbit(self.itemkeys)] = self.netname;
@@ -260,7 +255,8 @@ FLOATING: the item will float in air, instead of aligning to the floor by fallin
 ---------NOTES----------
 Don't use this entity on new maps! Use item_key instead.
 */
-void spawnfunc_item_key1(void) {
+void spawnfunc_item_key1(void)
+{SELFPARAM();
        self.classname = "item_key";
        self.itemkeys = ITEM_KEY_BIT(1);
        spawnfunc_item_key();
@@ -278,7 +274,8 @@ FLOATING: the item will float in air, instead of aligning to the floor by fallin
 ---------NOTES----------
 Don't use this entity on new maps! Use item_key instead.
 */
-void spawnfunc_item_key2(void) {
+void spawnfunc_item_key2(void)
+{SELFPARAM();
        self.classname = "item_key";
        self.itemkeys = ITEM_KEY_BIT(0);
        spawnfunc_item_key();