]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Try to make the maths more reliable in item respawning
authorMario <mario@smbclan.net>
Sat, 4 Mar 2017 17:05:20 +0000 (03:05 +1000)
committerMario <mario@smbclan.net>
Sat, 4 Mar 2017 17:05:20 +0000 (03:05 +1000)
qcsrc/common/t_items.qh

index 1b2293bcff0651d442032c328d7a0455783adb3b..198bd0f41193ea9ae52ceb47337a39560f916702 100644 (file)
@@ -63,9 +63,9 @@ bool have_pickup_item(entity this);
 
 const float ITEM_RESPAWN_TICKS = 10;
 
-#define ITEM_RESPAWNTIME(i)         ((i).respawntime + crandom() * (i).respawntimejitter)
+#define ITEM_RESPAWNTIME(i)         ((i).respawntime + (crandom() * (i).respawntimejitter))
        // range: respawntime - respawntimejitter .. respawntime + respawntimejitter
-#define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS))
+#define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + (random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS)))
        // range: 10 .. respawntime + respawntimejitter
 
 .float max_armorvalue;