]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/rpc.qc
Merge branch 'master' into TimePath/items
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / rpc.qc
index 71ddaa6b58acd7f77bde45fbca2cb917c70123bf..73794ca03aac47f72ce1e2b4e81b9223524dd4b7 100644 (file)
@@ -13,7 +13,7 @@ CLASS(RocketPropelledChainsaw, Weapon)
 /* crosshair */ ATTRIB(RocketPropelledChainsaw, w_crosshair_size, float, 0.6);
 /* wepimg    */ ATTRIB(RocketPropelledChainsaw, model2, string, "weaponrpc");
 /* refname   */ ATTRIB(RocketPropelledChainsaw, netname, string, "rpc");
-/* wepname   */ ATTRIB(RocketPropelledChainsaw, message, string, _("Rocket Propelled Chainsaw"));
+/* wepname   */ ATTRIB(RocketPropelledChainsaw, m_name, string, _("Rocket Propelled Chainsaw"));
 ENDCLASS(RocketPropelledChainsaw)
 REGISTER_WEAPON(RPC, NEW(RocketPropelledChainsaw));
 
@@ -47,7 +47,7 @@ RPC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #ifdef IMPLEMENTATION
 #ifdef SVQC
-spawnfunc(weapon_rpc) { weapon_defaultspawnfunc(WEP_RPC.m_id); }
+spawnfunc(weapon_rpc) { weapon_defaultspawnfunc(this, WEP_RPC); }
 
 void W_RocketPropelledChainsaw_Explode()
 {SELFPARAM();
@@ -153,23 +153,23 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep)
                {
                        self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
                }
-               METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, bool fire1, bool fire2))
+               METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        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 (fire & 1)
                                {
-                                       if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR(rpc, refire)))
+                                       if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR(rpc, refire)))
                                        {
                                                W_RocketPropelledChainsaw_Attack(thiswep);
-                                               weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR(rpc, animtime), w_ready);
+                                               weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR(rpc, animtime), w_ready);
                                        }
                                }
 
-                               if (fire2)
+                               if (fire & 2)
                                {
                                        // to-do
                                }