From: Rudolf Polzer Date: Thu, 11 Nov 2010 22:07:29 +0000 (+0100) Subject: fix a crash with crylink when only using 1 shot; fix fade_rate networking X-Git-Tag: xonotic-v0.1.0preview~155 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ea2bf33373f52c67a94bd1ba8ad6a39c1da800be;p=xonotic%2Fxonotic-data.pk3dir.git fix a crash with crylink when only using 1 shot; fix fade_rate networking --- diff --git a/qcsrc/server/csqcprojectile.qc b/qcsrc/server/csqcprojectile.qc index d250d39de..31e5b7788 100644 --- a/qcsrc/server/csqcprojectile.qc +++ b/qcsrc/server/csqcprojectile.qc @@ -13,7 +13,7 @@ float CSQCProjectile_SendEntity(entity to, float sf) if(self.flags & FL_ONGROUND) sf |= 0x40; - if(self.fade_time != 0 && self.fade_rate != 0) + if(self.fade_time != 0 || self.fade_rate != 0) { ft = (self.fade_time - time) / sys_frametime; fr = (1 / self.fade_rate) / sys_frametime; diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index 592582749..b783f5be6 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -284,7 +284,11 @@ void W_Crylink_Attack (void) proj.classname = "spike"; proj.bot_dodge = TRUE; proj.bot_dodgerating = cvar("g_balance_crylink_primary_damage"); - if(counter == 0) { // first projectile, store in firstproj for now + if(shots == 1) { + proj.queuenext = proj; + proj.queueprev = proj; + } + else if(counter == 0) { // first projectile, store in firstproj for now firstproj = proj; } else if(counter == shots - 1) { // last projectile, link up with first projectile @@ -326,13 +330,13 @@ void W_Crylink_Attack (void) if(counter == 0) { proj.fade_time = time + cvar("g_balance_crylink_primary_middle_lifetime"); - self.fade_rate = 1 / cvar("g_balance_crylink_primary_middle_fadetime"); + proj.fade_rate = 1 / cvar("g_balance_crylink_primary_middle_fadetime"); proj.nextthink = time + cvar("g_balance_crylink_primary_middle_lifetime") + cvar("g_balance_crylink_primary_middle_fadetime"); } else { proj.fade_time = time + cvar("g_balance_crylink_primary_other_lifetime"); - self.fade_rate = 1 / cvar("g_balance_crylink_primary_other_fadetime"); + proj.fade_rate = 1 / cvar("g_balance_crylink_primary_other_fadetime"); proj.nextthink = time + cvar("g_balance_crylink_primary_other_lifetime") + cvar("g_balance_crylink_primary_other_fadetime"); } proj.cnt = cvar("g_balance_crylink_primary_bounces"); @@ -373,7 +377,11 @@ void W_Crylink_Attack2 (void) proj.classname = "spike"; proj.bot_dodge = TRUE; proj.bot_dodgerating = cvar("g_balance_crylink_secondary_damage"); - if(counter == 0) { // first projectile, store in firstproj for now + if(shots == 1) { + proj.queuenext = proj; + proj.queueprev = proj; + } + else if(counter == 0) { // first projectile, store in firstproj for now firstproj = proj; } else if(counter == shots - 1) { // last projectile, link up with first projectile @@ -403,13 +411,13 @@ void W_Crylink_Attack2 (void) if(counter == (shots - 1) / 2) { proj.fade_time = time + cvar("g_balance_crylink_secondary_middle_lifetime"); - self.fade_rate = 1 / cvar("g_balance_crylink_secondary_middle_fadetime"); + proj.fade_rate = 1 / cvar("g_balance_crylink_secondary_middle_fadetime"); proj.nextthink = time + cvar("g_balance_crylink_secondary_middle_lifetime") + cvar("g_balance_crylink_secondary_middle_fadetime"); } else { proj.fade_time = time + cvar("g_balance_crylink_secondary_line_lifetime"); - self.fade_rate = 1 / cvar("g_balance_crylink_secondary_line_fadetime"); + proj.fade_rate = 1 / cvar("g_balance_crylink_secondary_line_fadetime"); proj.nextthink = time + cvar("g_balance_crylink_secondary_line_lifetime") + cvar("g_balance_crylink_secondary_line_fadetime"); } proj.cnt = cvar("g_balance_crylink_secondary_bounces");