From: Mario Date: Mon, 24 Aug 2015 05:35:54 +0000 (+1000) Subject: Add the remaining weapon model calls X-Git-Tag: xonotic-v0.8.2~2040^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=59f99f0c8e51847ac5ff91ab338314fa84ea4737;p=xonotic%2Fxonotic-data.pk3dir.git Add the remaining weapon model calls --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 1981c171d..91f3bfb4c 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -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) diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 91ca10557..e00b38c01 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -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); diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index a22a17110..22ad6aa92 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -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"); diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index a3949dab6..3054c40d2 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -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")); diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index 220566620..9247dffac 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -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")); diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index fede82567..17781e6d4 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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 = "";