]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove key-specific BIT macro
authorbones_was_here <bones_was_here@xonotic.au>
Sat, 16 Mar 2024 06:42:37 +0000 (16:42 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 17 Apr 2024 14:49:36 +0000 (00:49 +1000)
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/misc/keys.qc
qcsrc/common/mapobjects/misc/keys.qh

index 0250b48cf0b7ee87908791f47279a25b15b8269d..25e9ba844e75e89a5752569f2e81d2f061bd6b4f 100644 (file)
@@ -752,9 +752,9 @@ spawnfunc(func_door)
 {
        // Quake 1 and QL keys compatibility
        if (this.spawnflags & SPAWNFLAGS_GOLD_KEY)
-               this.itemkeys |= ITEM_KEY_BIT(0);
+               this.itemkeys |= BIT(0);
        if (this.spawnflags & SPAWNFLAGS_SILVER_KEY)
-               this.itemkeys |= ITEM_KEY_BIT(1);
+               this.itemkeys |= BIT(1);
 
        SetMovedir(this);
 
index 1b2b88e056aa14fa69b84075909adc456e13687b..b98ed6df2b19b3328b1fbb0828ee8c2fe0fbb14d 100644 (file)
@@ -227,9 +227,9 @@ spawnfunc(item_key)
 
        // find default model
        string _model = string_null;
-       if (this.itemkeys <= ITEM_KEY_BIT(2) || this.itemkeys == 0xffffff) {
+       if (this.itemkeys <= BIT(2) || this.itemkeys == 0xffffff) {
                _model = "models/keys/key.md3";
-       } else if (this.itemkeys >= ITEM_KEY_BIT(3) && this.itemkeys <= ITEM_KEY_BIT(5)) {
+       } else if (this.itemkeys >= BIT(3) && this.itemkeys <= BIT(5)) {
                _model = "models/keys/key.md3"; // FIXME: replace it by a keycard model!
        } else if (this.model == "") {
                objerror(this, "item_key doesn't have a default model for this key and a custom one was not specified!");
@@ -277,7 +277,7 @@ Don't use this entity on new maps! Use item_key instead.
 */
 spawnfunc(item_key1)
 {
-       this.itemkeys = ITEM_KEY_BIT(1);
+       this.itemkeys = BIT(1);
        spawnfunc_item_key(this);
 }
 
@@ -295,7 +295,7 @@ Don't use this entity on new maps! Use item_key instead.
 */
 spawnfunc(item_key2)
 {
-       this.itemkeys = ITEM_KEY_BIT(0);
+       this.itemkeys = BIT(0);
        spawnfunc_item_key(this);
 }
 
index 50be5f8dba7ef998c238dd68fbb531f6951da142..b381b5455cdd67bd30bac4f74fa55ff5006976fc 100644 (file)
@@ -1,10 +1,5 @@
 #pragma once
 
-/**
- * Returns the bit ID of a key
- */
-#define ITEM_KEY_BIT(n)        ( bitshift(1, n) )
-
 #define ITEM_KEY_MAX   24
 
 /**