]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/rpc.qc
Merge branch 'master' into terencehill/tooltips_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / rpc.qc
index 836b4be33acb7dab2325fd7e9da1d1f91c7ea56d..71ddaa6b58acd7f77bde45fbca2cb917c70123bf 100644 (file)
@@ -47,7 +47,7 @@ RPC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-void spawnfunc_weapon_rpc() { weapon_defaultspawnfunc(WEP_RPC.m_id); }
+spawnfunc(weapon_rpc) { weapon_defaultspawnfunc(WEP_RPC.m_id); }
 
 void W_RocketPropelledChainsaw_Explode()
 {SELFPARAM();
@@ -104,12 +104,12 @@ void W_RocketPropelledChainsaw_Think()
        self.nextthink = time;
 }
 
-void W_RocketPropelledChainsaw_Attack (void)
+void W_RocketPropelledChainsaw_Attack (Weapon thiswep)
 {SELFPARAM();
        entity missile = spawn(); //WarpZone_RefSys_SpawnSameRefSys(self);
        entity flash = spawn ();
 
-       W_DecreaseAmmo(WEP_CVAR(rpc, ammo));
+       W_DecreaseAmmo(thiswep, self, WEP_CVAR(rpc, ammo));
        W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', false, 5, SND(ROCKET_FIRE), CH_WEAPON_A, WEP_CVAR(rpc, damage));
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
        PROJECTILE_MAKETRIGGER(missile);
@@ -143,29 +143,29 @@ void W_RocketPropelledChainsaw_Attack (void)
        setmodel(flash, MDL_RPC_MUZZLEFLASH); // precision set below
        SUB_SetFade (flash, time, 0.1);
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-       W_AttachToShotorg(flash, '5 0 0');
+       W_AttachToShotorg(self, flash, '5 0 0');
        missile.pos1 = missile.velocity;
 
        MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
-               METHOD(RocketPropelledChainsaw, wr_aim, bool(entity thiswep))
+               METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep))
                {
                        self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
-                       return true;
                }
-               METHOD(RocketPropelledChainsaw, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+               METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, bool fire1, bool fire2))
                {
-                       if(WEP_CVAR(rpc, reload_ammo) && self.clip_load < WEP_CVAR(rpc, ammo))
-                               _WEP_ACTION(self.weapon, WR_RELOAD);
-                       else
+                       if(WEP_CVAR(rpc, reload_ammo) && actor.clip_load < WEP_CVAR(rpc, ammo)) {
+                               Weapon w = get_weaponinfo(actor.weapon);
+                               w.wr_reload(w);
+                       } else
                        {
                                if (fire1)
                                {
-                                       if(weapon_prepareattack(0, WEP_CVAR(rpc, refire)))
+                                       if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR(rpc, refire)))
                                        {
-                                               W_RocketPropelledChainsaw_Attack();
-                                               weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(rpc, animtime), w_ready);
+                                               W_RocketPropelledChainsaw_Attack(thiswep);
+                                               weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR(rpc, animtime), w_ready);
                                        }
                                }
 
@@ -174,13 +174,10 @@ void W_RocketPropelledChainsaw_Attack (void)
                                        // to-do
                                }
                        }
-
-                       return true;
                }
-               METHOD(RocketPropelledChainsaw, wr_init, bool(entity thiswep))
+               METHOD(RocketPropelledChainsaw, wr_init, void(entity thiswep))
                {
                        RPC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
-                       return true;
                }
                METHOD(RocketPropelledChainsaw, wr_checkammo1, bool(entity thiswep))
                {
@@ -192,24 +189,22 @@ void W_RocketPropelledChainsaw_Attack (void)
                {
                        return false;
                }
-               METHOD(RocketPropelledChainsaw, wr_config, bool(entity thiswep))
+               METHOD(RocketPropelledChainsaw, wr_config, void(entity thiswep))
                {
                        RPC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
-                       return true;
                }
-               METHOD(RocketPropelledChainsaw, wr_reload, bool(entity thiswep))
+               METHOD(RocketPropelledChainsaw, wr_reload, void(entity thiswep))
                {
-                       W_Reload(WEP_CVAR(rpc, ammo), SND(RELOAD));
-                       return true;
+                       W_Reload(self, WEP_CVAR(rpc, ammo), SND(RELOAD));
                }
-               METHOD(RocketPropelledChainsaw, wr_suicidemessage, bool(entity thiswep))
+               METHOD(RocketPropelledChainsaw, wr_suicidemessage, int(entity thiswep))
                {
                        if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
                                return WEAPON_RPC_SUICIDE_SPLASH;
                        else
                                return WEAPON_RPC_SUICIDE_DIRECT;
                }
-               METHOD(RocketPropelledChainsaw, wr_killmessage, bool(entity thiswep))
+               METHOD(RocketPropelledChainsaw, wr_killmessage, int(entity thiswep))
                {
                        if(w_deathtype & HITTYPE_SECONDARY)
                                return WEAPON_BLASTER_MURDER;
@@ -223,24 +218,13 @@ void W_RocketPropelledChainsaw_Attack (void)
 
 #ifdef CSQC
 
-               METHOD(RocketPropelledChainsaw, wr_impacteffect, bool(entity thiswep))
+               METHOD(RocketPropelledChainsaw, wr_impacteffect, void(entity thiswep))
                {
                        vector org2;
                        org2 = w_org + w_backoff * 12;
                        pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1);
                        if(!w_issilent)
                                sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
-
-                       return true;
-               }
-               METHOD(RocketPropelledChainsaw, wr_init, bool(entity thiswep))
-               {
-                       return true;
-               }
-               METHOD(RocketPropelledChainsaw, wr_zoomreticle, bool(entity thiswep))
-               {
-                       // no weapon specific image for this weapon
-                       return false;
                }
 
 #endif