fix in this branch.
/* flags */ WEP_FLAG_NORMAL,
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '1 1 1',
-/* firstpmdl */ "models/weapons/h_hlac.iqm",
-/* thirdpmdl */ "models/weapons/v_hlac.md3",
-/* pickupmdl */ "models/weapons/g_hlac.md3",
+/* modelname */ "hlac",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairhlac 0.7",
/* refname */ "arc",
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ 0,
/* color */ '1 0.5 0.5',
-/* firstpmdl */ "models/weapons/h_laser.iqm",
-/* thirdpmdl */ "models/weapons/v_laser.md3",
-/* pickupmdl */ "models/weapons/g_laser.md3",
+/* modelname */ "laser",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairlaser 0.4",
/* refname */ "laser",
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 0.5 1',
-/* firstpmdl */ "models/weapons/h_crylink.iqm",
-/* thirdpmdl */ "models/weapons/v_crylink.md3",
-/* pickupmdl */ "models/weapons/g_crylink.md3",
+/* modelname */ "crylink",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshaircrylink 0.4",
/* refname */ "crylink",
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '1 1 0',
-/* firstpmdl */ "models/weapons/h_rl.iqm",
-/* thirdpmdl */ "models/weapons/v_rl.md3",
-/* pickupmdl */ "models/weapons/g_rl.md3",
+/* modelname */ "rl",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairrocketlauncher 0.5875",
/* refname */ "devastator",
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0 0.5 1',
-/* firstpmdl */ "models/weapons/h_electro.iqm",
-/* thirdpmdl */ "models/weapons/v_electro.md3",
-/* pickupmdl */ "models/weapons/g_electro.md3",
+/* modelname */ "electro",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairelectro 0.5",
/* refname */ "electro",
/* flags */ WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 0.5 0',
-/* firstpmdl */ "models/weapons/h_fireball.iqm",
-/* thirdpmdl */ "models/weapons/v_fireball.md3",
-/* pickupmdl */ "models/weapons/g_fireball.md3",
+/* modelname */ "fireball",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairfireball",
/* refname */ "fireball",
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 1 0.5',
-/* firstpmdl */ "models/weapons/h_hagar.iqm",
-/* thirdpmdl */ "models/weapons/v_hagar.md3",
-/* pickupmdl */ "models/weapons/g_hagar.md3",
+/* modelname */ "hagar",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairhagar 0.8",
/* refname */ "hagar",
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0 1 0',
-/* firstpmdl */ "models/weapons/h_hlac.iqm",
-/* thirdpmdl */ "models/weapons/v_hlac.md3",
-/* pickupmdl */ "models/weapons/g_hlac.md3",
+/* modelname */ "hlac",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairhlac 0.6",
/* refname */ "hlac",
/* flags */ WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ 0,
/* color */ '0 0.5 0',
-/* firstpmdl */ "models/weapons/h_hookgun.iqm",
-/* thirdpmdl */ "models/weapons/v_hookgun.md3",
-/* pickupmdl */ "models/weapons/g_hookgun.md3",
+/* modelname */ "hookgun",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairhook 0.5",
/* refname */ "hook",
/* flags */ WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 1 0',
-/* firstpmdl */ "models/weapons/h_uzi.iqm",
-/* thirdpmdl */ "models/weapons/v_uzi.md3",
-/* pickupmdl */ "models/weapons/g_uzi.md3",
+/* modelname */ "uzi",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairuzi 0.6",
/* refname */ "uzi",
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '0.75 1 0',
-/* firstpmdl */ "models/weapons/h_minelayer.iqm",
-/* thirdpmdl */ "models/weapons/v_minelayer.md3",
-/* pickupmdl */ "models/weapons/g_minelayer.md3",
+/* modelname */ "minelayer",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairminelayer 0.9",
/* refname */ "minelayer",
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 0 0',
-/* firstpmdl */ "models/weapons/h_gl.iqm",
-/* thirdpmdl */ "models/weapons/v_gl.md3",
-/* pickupmdl */ "models/weapons/g_gl.md3",
+/* modelname */ "gl",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairgrenadelauncher 0.7",
/* refname */ "grenadelauncher",
/* flags */ WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON,
/* rating */ 0,
/* color */ '0.5 0.5 0.5',
-/* firstpmdl */ "models/weapons/h_porto.iqm",
-/* thirdpmdl */ "models/weapons/v_porto.md3",
-/* pickupmdl */ "models/weapons/g_porto.md3",
+/* modelname */ "porto",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairporto 0.6",
/* refname */ "porto",
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0.5 1 0',
-/* firstpmdl */ "models/weapons/h_campingrifle.iqm",
-/* thirdpmdl */ "models/weapons/v_campingrifle.md3",
-/* pickupmdl */ "models/weapons/g_campingrifle.md3",
+/* modelname */ "campingrifle",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairrifle 0.5",
/* refname */ "rifle",
/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0.5 1 0',
-/* firstpmdl */ "models/weapons/h_seeker.iqm",
-/* thirdpmdl */ "models/weapons/v_seeker.md3",
-/* pickupmdl */ "models/weapons/g_seeker.md3",
+/* modelname */ "seeker",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairseeker 0.8",
/* refname */ "seeker",
/* flags */ WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_LOW,
/* color */ '0.5 0.25 0',
-/* firstpmdl */ "models/weapons/h_shotgun.iqm",
-/* thirdpmdl */ "models/weapons/v_shotgun.md3",
-/* pickupmdl */ "models/weapons/g_shotgun.md3",
+/* modelname */ "shotgun",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairshotgun 0.7",
/* refname */ "shockwave",
/* flags */ WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_MUTATORBLOCKED,
/* rating */ BOT_PICKUP_RATING_LOW,
/* color */ '0.5 0.25 0',
-/* firstpmdl */ "models/weapons/h_shotgun.iqm",
-/* thirdpmdl */ "models/weapons/v_shotgun.md3",
-/* pickupmdl */ "models/weapons/g_shotgun.md3",
+/* modelname */ "shotgun",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairshotgun 0.65",
/* refname */ "shotgun",
/* flags */ WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH,
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0 1 0',
-/* firstpmdl */ "models/weapons/h_tuba.iqm",
-/* thirdpmdl */ "models/weapons/v_tuba.md3",
-/* pickupmdl */ "models/weapons/g_tuba.md3",
+/* modelname */ "tuba",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairtuba",
/* refname */ "tuba",
/* flags */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '0.5 1 1',
-/* firstpmdl */ "models/weapons/h_minstanex.iqm",
-/* thirdpmdl */ "models/weapons/v_minstanex.md3",
-/* pickupmdl */ "models/weapons/g_minstanex.md3",
+/* modelname */ "minstanex",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairminstanex 0.4",
/* refname */ "minstanex",
/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '0.5 1 1',
-/* firstpmdl */ "models/weapons/h_nex.iqm",
-/* thirdpmdl */ "models/weapons/v_nex.md3",
-/* pickupmdl */ "models/weapons/g_nex.md3",
+/* modelname */ "nex",
/* simplemdl */ "foobar",
/* crosshair */ "gfx/crosshairnex 0.65",
/* refname */ "nex",
float weapontype,
float pickupbasevalue,
vector clr,
- string firstpmdl,
+ string modelname,
string thirdpmdl,
string pickupmdl,
string simplemdl,
e.bot_pickupbasevalue = pickupbasevalue;
e.wpcolor = clr;
e.wpmodel = strzone(strcat("wpn-", ftos(id)));
- e.w_firstpmdl = strzone(firstpmdl); // first person view weapon model (h_)
- e.w_thirdpmdl = strzone(thirdpmdl); // third person weapon model (v_)
- e.w_pickupmdl = strzone(pickupmdl); // pickup weapon model (g_)
+ e.mdl = modelname;
+ e.model = strzone(strcat("models/weapons/g_", modelname, ".md3"));
e.w_simplemdl = strzone(simplemdl); // simpleitems weapon model/image
e.w_crosshair = strzone(car(crosshair));
string s = cdr(crosshair);
dummy_weapon_info.message = "AOL CD Thrower";
dummy_weapon_info.weapon_func = w_null;
dummy_weapon_info.wpmodel = "";
- dummy_weapon_info.w_firstpmdl = "";
- dummy_weapon_info.w_thirdpmdl = "";
- dummy_weapon_info.w_pickupmdl = "";
- dummy_weapon_info.w_simplemdl = "";
+ dummy_weapon_info.mdl = "";
+ dummy_weapon_info.model = "";
dummy_weapon_info.spawnflags = 0;
dummy_weapon_info.impulse = -1;
dummy_weapon_info.bot_pickupbasevalue = 0;
float weapontype,
float pickupbasevalue,
vector clr,
- string firstpmdl,
- string thirdpmdl,
- string pickupmdl,
+ string modelname,
string simplemdl,
string crosshair,
string refname,
.float bot_pickupbasevalue; // M: rating // bot weapon priority
.vector wpcolor; // M: color // waypointsprite color
.string wpmodel; // A: wpn-id // wpn- sprite name
-.string w_firstpmdl; // M: firstpmdl // first person view weapon model (h_)
-.string w_thirdpmdl; // M: thirdpmdl // third person weapon model (v_)
-.string w_pickupmdl; // M: pickupmdl // pickup weapon model (g_)
+.string mdl; // M: modelname // name of model (without g_ v_ or h_ prefixes)
+.string model; // A: modelname // full path to g_ model
.string w_simplemdl; // M: simplemdl // simpleitems weapon model/image
.string w_crosshair; // M: crosshair // per-weapon crosshair: "CrosshairImage Size"
.float w_crosshair_size; // A: crosshair // per-weapon crosshair size (argument two of "crosshair" field)
.string netname; // M: refname // reference name name
.string message; // M: wepname // human readable name
-#define WEP_MODEL_FIRSTPERSON model
-#define WEP_MODEL_THIRDPERSON model2
-#define WEP_MODEL_PICKUP model3
-#define WEP_MODEL_SIMPLE mdl
-
// note: the fabs call is just there to hide "if result is constant" warning
-#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,firstpmdl,thirdpmdl,pickupmdl,simplemdl,crosshair,refname,wepname) \
+#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,refname,wepname) \
float id; \
WepSet bit; \
float function(float); \
if((flags) & WEP_FLAG_SUPERWEAPON) \
WEPSET_SUPERWEAPONS |= bit; \
++WEP_COUNT; \
- register_weapon(id,bit,function,ammotype,impulse,flags,rating,color,firstpmdl,thirdpmdl,pickupmdl,simplemdl,crosshair,refname,wepname); \
+ register_weapon(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,refname,wepname); \
} \
ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)
#ifdef MENUQC
-#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,firstpmdl,thirdpmdl,pickupmdl,simplemdl,crosshair,refname,wepname) \
- REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,impulse,flags,rating,color,firstpmdl,thirdpmdl,pickupmdl,simplemdl,crosshair,refname,wepname)
+#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,refname,wepname) \
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,refname,wepname)
#else
-#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,firstpmdl,thirdpmdl,pickupmdl,simplemdl,crosshair,refname,wepname) \
- REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,firstpmdl,thirdpmdl,pickupmdl,simplemdl,crosshair,refname,wepname)
+#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,refname,wepname) \
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,refname,wepname)
#endif
#include "all.qh"
.string item_pickupsound;
// definitions for weaponsystem
-
+// more WEAPONTODO: move these to their proper files
.entity weaponentity;
.entity exteriorweaponentity;
.vector weaponentity_glowmod;
float warmup_start_armorvalue;
float g_weapon_stay;
-float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO
+float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
{
var float i = weaponinfo.weapon;
var float d = 0;
===========================================================================
*/
-// WEAPONTODO: move to the .qh file
+
.float weapon_frametime;
float W_WeaponRateFactor()
// to free:
// call again with ""
// remove the ent
-
-//#define WEP_MODEL_FIRSTPERSON model // h_ // wep.WEP_MODEL_FIRSTPERSON
-//#define WEP_MODEL_THIRDPERSON model2 // v_ // wep.WEP_MODEL_THIRDPERSON
-//#define WEP_MODEL_PICKUP model3 // g_ // wep.WEP_MODEL_PICKUP
-//#define WEP_MODEL_SIMPLE mdl
-void CL_WeaponEntity_SetModel(entity wep)
+void CL_WeaponEntity_SetModel(string name)
{
float v_shot_idx;
- if(wep)
+ if (name != "")
{
// if there is a child entity, hide it until we're sure we use it
if (self.weaponentity)
self.weaponentity.model = "";
- setmodel(self, wep.WEP_MODEL_THIRDPERSON); // precision set below
+ setmodel(self, strcat("models/weapons/v_", name, ".md3")); // precision set below
v_shot_idx = gettagindex(self, "shot"); // used later
if(!v_shot_idx)
v_shot_idx = gettagindex(self, "tag_shot");
- setmodel(self, wep.WEP_MODEL_FIRSTPERSON); // precision set below
+ setmodel(self, strcat("models/weapons/h_", name, ".iqm")); // precision set below
// 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');
{
if (!self.weaponentity)
self.weaponentity = spawn();
- setmodel(self.weaponentity, wep.WEP_MODEL_THIRDPERSON); // precision does not matter
+ setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
setattachment(self.weaponentity, self, "weapon");
}
else if(gettagindex(self, "tag_weapon"))
{
if (!self.weaponentity)
self.weaponentity = spawn();
- setmodel(self.weaponentity, wep.WEP_MODEL_THIRDPERSON); // precision does not matter
+ setmodel(self.weaponentity, strcat("models/weapons/v_", name, ".md3")); // precision does not matter
setattachment(self.weaponentity, self, "tag_weapon");
}
else
vector CL_Weapon_GetShotOrg(float wpn)
{
- entity oldself;
+ entity wi, oldself;
vector ret;
+ wi = get_weaponinfo(wpn);
oldself = self;
self = spawn();
- CL_WeaponEntity_SetModel(get_weaponinfo(wpn));
+ CL_WeaponEntity_SetModel(wi.mdl);
ret = self.movedir;
- CL_WeaponEntity_SetModel(world);
+ CL_WeaponEntity_SetModel("");
remove(self);
self = oldself;
return ret;
self.weaponentity.model = "";
return;
}
- if (self.weaponname != self.owner.weaponname || self.dmg != self.owner.modelindex || self.deadflag != self.owner.deadflag) // WEAPONTODO: get rid of .weaponname, handle model directly
+ if (self.weaponname != self.owner.weaponname || self.dmg != self.owner.modelindex || self.deadflag != self.owner.deadflag)
{
self.weaponname = self.owner.weaponname;
self.dmg = self.owner.modelindex;
self.deadflag = self.owner.deadflag;
- // WEAPONTODO: get weapon entity from here!
- //CL_WeaponEntity_SetModel(self.owner.weaponname);
+ CL_WeaponEntity_SetModel(self.owner.weaponname);
}
tb = (self.effects & (EF_TELEPORT_BIT | EF_RESTARTANIM_BIT));