]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_laser.qc
Merge remote-tracking branch 'origin/master' into samual/notifications
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_laser.qc
index 5e034acb908f9bfe6b1b9a085b8c4dd10dd17a24..69dcb17aa5c292d4328b539668c8dac674f76935 100644 (file)
@@ -3,12 +3,13 @@ REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WE
 #else
 #ifdef SVQC
 void(float imp) W_SwitchWeapon;
+void() W_LastWeapon;
 
 void W_Laser_Touch (void)
 {
        PROJECTILE_TOUCH;
 
-       self.event_damage = SUB_Null;
+       self.event_damage = func_null;
        if (self.dmg)
                RadiusDamage (self, self.realowner, autocvar_g_balance_laser_secondary_damage, autocvar_g_balance_laser_secondary_edgedamage, autocvar_g_balance_laser_secondary_radius, world, autocvar_g_balance_laser_secondary_force, self.projectiledeathtype, other);
        else
@@ -30,7 +31,7 @@ void W_Laser_Think()
 
 void W_Laser_Attack (float issecondary)
 {
-       local entity missile;
+       entity missile;
        vector s_forward;
        float a;
        float nodamage;
@@ -74,6 +75,7 @@ void W_Laser_Attack (float issecondary)
        missile.touch = W_Laser_Touch;
 
        missile.flags = FL_PROJECTILE;
+       missile.missile_flags = MIF_SPLASH; 
 
        missile.think = W_Laser_Think;
        missile.nextthink = time + autocvar_g_balance_laser_primary_delay;
@@ -214,8 +216,8 @@ void spawnfunc_weapon_laser (void)
 
 float w_laser(float req)
 {
-       local float r1;
-       local float r2;
+       float r1;
+       float r2;
        if (req == WR_AIM)
        {
                if(autocvar_g_balance_laser_secondary)
@@ -259,7 +261,7 @@ float w_laser(float req)
                        else
                        {
                                if(self.switchweapon == WEP_LASER) // don't do this if already switching
-                                       W_SwitchWeapon (self.cnt);
+                                       W_LastWeapon();
                        }
                }
        }
@@ -289,8 +291,16 @@ float w_laser(float req)
        {
                W_Reload(0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_LASER_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_LASER_MURDER;
+       }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_laser(float req)
@@ -307,15 +317,6 @@ float w_laser(float req)
        {
                precache_sound("weapons/laserimpact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s lasered themself to hell");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was cut in half by %s's gauntlet"); // unchecked: SPLASH
-               else
-                       w_deathtypestring = _("%s was lasered to death by %s"); // unchecked: SPLASH
-       }
        return TRUE;
 }
 #endif