]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add the remaining weapon model calls
authorMario <zacjardine@y7mail.com>
Mon, 24 Aug 2015 05:35:54 +0000 (15:35 +1000)
committerMario <zacjardine@y7mail.com>
Mon, 24 Aug 2015 05:35:54 +0000 (15:35 +1000)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/weapons/all.qh
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_overkill.qc
qcsrc/server/weapons/weaponsystem.qc

index 1981c171dcd6c3f6040a1b1d5e61d2d0183dc074..91f3bfb4c6410f6b163e38eba85b882635bd6cfa 100644 (file)
@@ -436,9 +436,9 @@ void CSQCModel_AutoTagIndex_Apply(void)
                        if(self.tag_entity)
                        {
                                // the best part is: IT EXISTS
-                               if(substring(self.model, 0, 17) == "models/weapons/v_")
+                               if(substring(self.model, 0, 14) == "models/weapons")
                                {
-                                       if(substring(self.tag_entity.model, 0, 17) == "models/weapons/h_")
+                                       if(substring(self.tag_entity.model, 0, 14) == "models/weapons")
                                        {
                                                self.tag_index = gettagindex(self.tag_entity, "weapon");
                                                if(!self.tag_index)
@@ -458,7 +458,7 @@ void CSQCModel_AutoTagIndex_Apply(void)
                                        }
                                }
 
-                               if(substring(self.tag_entity.model, 0, 17) == "models/weapons/v_")
+                               if(substring(self.tag_entity.model, 0, 14) == "models/weapons")
                                {
                                        self.tag_index = gettagindex(self.tag_entity, "shot");
                                        if(!self.tag_index)
index 91ca10557a2cfd5ec7e5fbf91acddad278ba500a..e00b38c0154df658bf3284c401583cb2e411198b 100644 (file)
@@ -214,7 +214,11 @@ CLASS(Weapon, Object)
                this.bot_pickupbasevalue = pickupbasevalue;
                this.wpcolor = clr;
                this.mdl = modelname;
+               #ifdef SVQC
+               this.model = strzone(W_Model(strcat("g_", modelname, ".md3")));
+               #elif defined(CSQC)
                this.model = strzone(strcat("models/weapons/g_", modelname, ".md3"));
+               #endif
                this.w_simplemdl = strzone(simplemdl); // simpleitems weapon model/image
                this.w_crosshair = strzone(car(crosshair));
                string s = cdr(crosshair);
index a22a17110ba5d0e25fe67f72050463af0087838b..22ad6aa92c4c5d27628eabcefa9c5dbf1eb73225 100644 (file)
@@ -863,9 +863,9 @@ float w_nexball_weapon(float req)
        }
        else if(req == WR_INIT)
        {
-               precache_model("models/weapons/g_porto.md3");
-               precache_model("models/weapons/v_porto.md3");
-               precache_model("models/weapons/h_porto.iqm");
+               precache_model(W_Model("g_porto.md3"));
+               precache_model(W_Model("v_porto.md3"));
+               precache_model(W_Model("h_porto.iqm"));
                precache_model("models/elaser.mdl");
                precache_sound("nexball/shoot1.wav");
                precache_sound("nexball/shoot2.wav");
index a3949dab6727d53f86891900f23a61147c6057f8..3054c40d25df94835abb022357c2e947737e4aef 100644 (file)
@@ -682,7 +682,7 @@ void toss_nade(entity e, vector _velocity, float _time)
                offset = '0 0 0';
 
        setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
-       //setmodel(_nade, "models/weapons/v_ok_grenade.md3");
+       //setmodel(_nade, W_Model("v_ok_grenade.md3"));
        //setattachment(_nade, world, "");
        PROJECTILE_MAKETRIGGER(_nade);
        setsize(_nade, '-16 -16 -16', '16 16 16');
@@ -815,7 +815,7 @@ void nade_prime()
 
        n.nade_type = bound(1, n.nade_type, NADES_COUNT);
 
-       setmodel(n, "models/weapons/v_ok_grenade.md3");
+       setmodel(n, W_Model("v_ok_grenade.md3"));
        //setattachment(n, self, "bip01 l hand");
        n.exteriormodeltoclient = self;
        n.customizeentityforclient = nade_customize;
@@ -830,7 +830,7 @@ void nade_prime()
        n.nextthink = max(n.wait - 3, time);
        n.projectiledeathtype = DEATH_NADE;
 
-       setmodel(fn, "models/weapons/h_ok_grenade.iqm");
+       setmodel(fn, W_Model("h_ok_grenade.iqm"));
        setattachment(fn, self.weaponentity, "");
        fn.realowner = fn.owner = self;
        fn.colormod = NADES[n.nade_type].m_color;
@@ -1189,8 +1189,8 @@ void nades_Initialize()
        addstat(STAT_HEALING_ORB_ALPHA, AS_FLOAT, stat_healing_orb_alpha);
 
        precache_model("models/ok_nade_counter/ok_nade_counter.md3");
-       precache_model("models/weapons/h_ok_grenade.iqm");
-       precache_model("models/weapons/v_ok_grenade.md3");
+       precache_model(W_Model("h_ok_grenade.iqm"));
+       precache_model(W_Model("v_ok_grenade.md3"));
        precache_model("models/ctf/shield.md3");
 
        precache_sound(W_Sound("rocket_impact"));
index 22056662077375f25ad476a60238030fd10bedf5..9247dffacaf1317ab1fbccb4157fdaa9de7fbf89 100644 (file)
@@ -215,7 +215,7 @@ MUTATOR_HOOKFUNCTION(ok_OnEntityPreSpawn)
                {
                        entity wep = spawn();
                        setorigin(wep, self.origin);
-                       setmodel(wep, "models/weapons/g_ok_hmg.md3");
+                       setmodel(wep, W_Model("g_ok_hmg.md3"));
                        wep.classname = "weapon_hmg";
                        wep.ok_item = true;
                        wep.noalign = self.noalign;
@@ -232,7 +232,7 @@ MUTATOR_HOOKFUNCTION(ok_OnEntityPreSpawn)
                {
                        entity wep = spawn();
                        setorigin(wep, self.origin);
-                       setmodel(wep, "models/weapons/g_ok_rl.md3");
+                       setmodel(wep, W_Model("g_ok_rl.md3"));
                        wep.classname = "weapon_rpc";
                        wep.ok_item = true;
                        wep.noalign = self.noalign;
@@ -317,17 +317,17 @@ void ok_Initialize()
 
        precache_all_playermodels("models/ok_player/*.dpm");
 
-       precache_model("models/weapons/h_ok_mg.iqm");
-       precache_model("models/weapons/v_ok_mg.md3");
-       precache_model("models/weapons/g_ok_mg.md3");
+       precache_model(W_Model("h_ok_mg.iqm"));
+       precache_model(W_Model("v_ok_mg.md3"));
+       precache_model(W_Model("g_ok_mg.md3"));
 
-       precache_model("models/weapons/h_ok_shotgun.iqm");
-       precache_model("models/weapons/v_ok_shotgun.md3");
-       precache_model("models/weapons/g_ok_shotgun.md3");
+       precache_model(W_Model("h_ok_shotgun.iqm"));
+       precache_model(W_Model("v_ok_shotgun.md3"));
+       precache_model(W_Model("g_ok_shotgun.md3"));
 
-       precache_model("models/weapons/h_ok_sniper.iqm");
-       precache_model("models/weapons/v_ok_sniper.md3");
-       precache_model("models/weapons/g_ok_sniper.md3");
+       precache_model(W_Model("h_ok_sniper.iqm"));
+       precache_model(W_Model("v_ok_sniper.md3"));
+       precache_model(W_Model("g_ok_sniper.md3"));
 
        precache_sound(W_Sound("dryfire"));
 
index fede825675d69c7a78d1f273e91c58d17f6adb4c..17781e6d4c955e475af42d57bc8585ff8b496740 100644 (file)
@@ -117,12 +117,12 @@ void CL_WeaponEntity_SetModel(string name)
                // if there is a child entity, hide it until we're sure we use it
                if (self.weaponentity)
                        self.weaponentity.model = "";
-               setmodel(self, strcat("models/weapons/v_", name, ".md3")); // precision set below
+               setmodel(self, W_Model(strcat("v_", name, ".md3")));
                v_shot_idx = gettagindex(self, "shot"); // used later
                if(!v_shot_idx)
                        v_shot_idx = gettagindex(self, "tag_shot");
 
-               setmodel(self, strcat("models/weapons/h_", name, ".iqm")); // precision set below
+               setmodel(self, W_Model(strcat("h_", name, ".iqm")));
                // preset some defaults that work great for renamed zym files (which don't need an animinfo)
                self.anim_fire1  = animfixfps(self, '0 1 0.01', '0 0 0');
                self.anim_fire2  = animfixfps(self, '1 1 0.01', '0 0 0');
@@ -135,14 +135,14 @@ void CL_WeaponEntity_SetModel(string name)
                {
                        if (!self.weaponentity)
                                self.weaponentity = spawn();
-                       setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
+                       setmodel(self.weaponentity, W_Model(strcat("v_", name, ".md3")));
                        setattachment(self.weaponentity, self, "weapon");
                }
                else if(gettagindex(self, "tag_weapon"))
                {
                        if (!self.weaponentity)
                                self.weaponentity = spawn();
-                       setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
+                       setmodel(self.weaponentity, W_Model(strcat("v_", name, ".md3")));
                        setattachment(self.weaponentity, self, "tag_weapon");
                }
                else
@@ -379,7 +379,7 @@ void CL_ExteriorWeaponentity_Think()
                self.dmg = self.owner.modelindex;
                self.deadflag = self.owner.deadflag;
                if (self.owner.weaponname != "")
-                       setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3")); // precision set below
+                       setmodel(self, W_Model(strcat("v_", self.owner.weaponname, ".md3")));
                else
                        self.model = "";