r131 - trunk/progsqc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Dec 12 18:17:02 EST 2008


Author: vermeulen
Date: 2008-12-12 18:17:02 -0500 (Fri, 12 Dec 2008)
New Revision: 131

Modified:
   trunk/progsqc/actor.qc
   trunk/progsqc/bots.qc
   trunk/progsqc/gamedefs.qc
   trunk/progsqc/inventory.qc
   trunk/progsqc/player.qc
Log:
Items work again

Modified: trunk/progsqc/actor.qc
===================================================================
--- trunk/progsqc/actor.qc	2008-10-20 15:05:46 UTC (rev 130)
+++ trunk/progsqc/actor.qc	2008-12-12 23:17:02 UTC (rev 131)
@@ -271,32 +271,32 @@
 	oldself = self;
 	self = self.owner;
 	
-	//Inventory_GetItemInfo(self, self.weaponitem);  YEAH!!!
+	//Inventory_Getweapinfo(self, self.weaponitem);  YEAH!!!
 	if (animdone)
 	{
 		if (self.weaponstate == WS_LOWER)
 		{
 			if (time >= self.lowerguntime)
 			{				
-				actor_setviewmodeloffset(self.iteminfo_viewmodeloffset);
+				actor_setviewmodeloffset(self.weapinfo_viewmodeloffset);
 				self.viewmodelchange_x = 0;
 				self.viewmodelchange_z = -20;
 				self.weaponitem = self.switchweaponitem;
-				Inventory_GetItemInfo(self, self.weaponitem);
-				actor_setweaponmodel(self.iteminfo_model, self.iteminfo_weapon_viewmodel);
+				Inventory_Getweapinfo(self, self.weaponitem);
+				actor_setweaponmodel(self.weapinfo_model, self.weapinfo_weapon_viewmodel);
 
 				weapon_state(WS_RAISE);
 			}
 		}
 		else if (self.weaponstate == WS_RELOAD)
 		{
-			if (self.iteminfo_ammotype >= 0)
+			if (self.weapinfo_ammotype >= 0)
 			{
-				f1 = min(self.iteminfo_ammomax - self.iteminfo_ammo, self.iteminfo_ammoinventory);
+				f1 = min(self.weapinfo_ammomax - self.weapinfo_ammo, self.weapinfo_ammoinventory);
 				if (f1 > 0)
 				{
 					Inventory_ModifyItem(self, self.weaponitem, 0, f1);
-					Inventory_ModifyItem(self, self.iteminfo_ammotype, 0 - f1, 0);
+					Inventory_ModifyItem(self, self.weapinfo_ammotype, 0 - f1, 0);
 				}
 			}
 			weapon_state(WS_IDLE);
@@ -315,7 +315,7 @@
 	}
 	if (self.weaponstate == WS_IDLE)
 	{
-		if (!self.iteminfo_weapon_canraise)
+		if (!self.weapinfo_weapon_canraise)
 		{
 			f1 = Inventory_GetBestWeapon(self);
 			if (f1 >= 0)
@@ -328,13 +328,13 @@
 			//bprint("lowering\n");
 			weapon_state(WS_LOWER);
 		}
-		else if ((self.iteminfo_ammo <= self.iteminfo_ammo1minimumtofire) && (cvar("g_autoreload")) && (self.iteminfo_ammoinventory >= 1))
+		else if ((self.weapinfo_ammo <= self.weapinfo_ammo1minimumtofire) && (cvar("g_autoreload")) && (self.weapinfo_ammoinventory >= 1))
 			weapon_state(WS_RELOAD);
-		else if (self.button4 && ((self.iteminfo_ammo < self.iteminfo_ammomax && self.iteminfo_ammoinventory >= 1)))
+		else if (self.button4 && ((self.weapinfo_ammo < self.weapinfo_ammomax && self.weapinfo_ammoinventory >= 1)))
 			weapon_state(WS_RELOAD);
-		else if (self.button0 && self.weapon_canfire1 && (!self.weapon_oldbutton0 || !(self.iteminfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
+		else if (self.button0 && self.weapon_canfire1 && (!self.weapon_oldbutton0 || !(self.weapinfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
 			weapon_state(WS_FIRE1);
-		else if (self.button3 && self.weapon_canfire2 && (!self.weapon_oldbutton3 || !(self.iteminfo_ammo2fireflags & FIREFLAG_SEMIAUTOMATIC)))
+		else if (self.button3 && self.weapon_canfire2 && (!self.weapon_oldbutton3 || !(self.weapinfo_ammo2fireflags & FIREFLAG_SEMIAUTOMATIC)))
 			weapon_state(WS_FIRE2);
 	}
 	self.weapon_oldbutton0 = self.button0;
@@ -350,7 +350,7 @@
 		return;
 	oldself = self;
 	self = self.owner;
-	//Inventory_GetItemInfo(self, self.weaponitem); YEAH!!!!
+	//Inventory_Getweapinfo(self, self.weaponitem); YEAH!!!!
 	anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
 	self = oldself;
 };
@@ -358,7 +358,7 @@
 void(float newstate) weapon_state =
 {
 	self.weaponstate = newstate;
-	//Inventory_GetItemInfo(self, self.weaponitem);
+	//Inventory_Getweapinfo(self, self.weaponitem);
 		   
 	if (newstate == WS_IDLE)
 	{
@@ -371,56 +371,56 @@
 			sound(self, CHAN_WEAPON2, "weapons/minigun_whirlend.wav", 0.5, ATTN_NORM); // templeofnoise
 			self.weaponsound_cycle = 0; // templeofnoise
 		}
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_idle, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_idle, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
 	}
 	else if (newstate == WS_FIRE1)
 	{
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_fire1, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_fire1, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
-		self.viewmodelchange = self.viewmodelchange + self.iteminfo_ammo1viewmodelpush;
+		self.viewmodelchange = self.viewmodelchange + self.weapinfo_ammo1viewmodelpush;
 		self.viewmodelchange_y = self.viewmodelchange_y + crandom();
-		//bprint("weapon_state ");bprint(ftos(newstate));bprint(":");bprint(vtos(self.iteminfo_weapon_viewmodelanim_fire1));bprint(" ");bprint(ftos(self.actorpart_torso.anim_frametime));bprint("\n");
-		Inventory_GetItemInfo(self, self.weaponitem);
+		//bprint("weapon_state ");bprint(ftos(newstate));bprint(":");bprint(vtos(self.weapinfo_weapon_viewmodelanim_fire1));bprint(" ");bprint(ftos(self.actorpart_torso.anim_frametime));bprint("\n");
+		Inventory_Getweapinfo(self, self.weaponitem);
 		weapon_fire(FALSE);
 	}
 	else if (newstate == WS_FIRE2)
 	{
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_fire2, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_fire2, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
-		self.viewmodelchange = self.viewmodelchange + self.iteminfo_ammo2viewmodelpush;
-		Inventory_GetItemInfo(self, self.weaponitem);
+		self.viewmodelchange = self.viewmodelchange + self.weapinfo_ammo2viewmodelpush;
+		Inventory_Getweapinfo(self, self.weaponitem);
 		weapon_fire(TRUE);
 	}
 	else if (newstate == WS_FIRE3)
 	{
-	 	//Inventory_GetItemInfo(self, self.itemselected);
+	 	//Inventory_Getweapinfo(self, self.itemselected);
 		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_ATTACK, ANIMTYPE_IDLE, torso_animframefunc);
 		//weapon_fire(FALSE);
 	}
 	else if (newstate == WS_RELOAD)
 	{
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_reload, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_reload, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_RELOAD, ANIMTYPE_IDLE, torso_animframefunc);
 	}
 	else if (newstate == WS_LOWER)
 	{
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_lower, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_lower, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_DROP, ANIMTYPE_IDLE, torso_animframefunc);
 	}
 	else if (newstate == WS_RAISE)
 	{
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_raise, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_raise, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_RAISE, ANIMTYPE_IDLE, torso_animframefunc);
 	}
 	else if (newstate == WS_TURNON)
 	{
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_turnon, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_turnon, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_IDLE, ANIMTYPE_IDLE, torso_animframefunc);
 	}
 	else if (newstate == WS_TURNOFF)
 	{
-		anim_start(self.actorpart_viewweapon, self.iteminfo_weapon_viewmodelanim_turnoff, ANIMTYPE_IDLE, viewweapon_animframefunc);
+		anim_start(self.actorpart_viewweapon, self.weapinfo_weapon_viewmodelanim_turnoff, ANIMTYPE_IDLE, viewweapon_animframefunc);
 		//anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_IDLE, ANIMTYPE_IDLE, torso_animframefunc);
 	}
 };
@@ -462,65 +462,65 @@
 	if (secondary)
 	{
 		shotorg = muzzle2tagorigin; // overridden on hagar
-		shotdir = self.iteminfo_ammo2speeds;
-		shotdamage = self.iteminfo_ammo2damage;
-		shotdamagetype = self.iteminfo_ammo2damagetype;
-		shotlifetime = self.iteminfo_ammo2lifetime;
-		shotprojflags = self.iteminfo_ammo2projflags;
-		shotfireflags = self.iteminfo_ammo2fireflags;
-		shotexplflags = self.iteminfo_ammo2explflags;
-		shottrailflags = self.iteminfo_ammo2trailflags;
-		shoteffectflags = self.iteminfo_ammo2effectflags;
-		shotmodel = self.iteminfo_ammo2model;
-		shotfiresound = self.iteminfo_ammo2firesound;
-		shotexplodesound = self.iteminfo_ammo2explodesound;
-		shotbouncesound = self.iteminfo_ammo2bouncesound;
-		numberof = self.iteminfo_ammo2numberof;
-		recoil = self.iteminfo_ammo2recoil;
-		mintofire = self.iteminfo_ammo2minimumtofire;
-		tracer = self.iteminfo_ammo2tracer;
-		tracermodel = self.iteminfo_ammo2tracermodel;
-		modelscale = self.iteminfo_ammo2modelscale;
-		projhealth = self.iteminfo_ammo2health;
-		projmass = self.iteminfo_ammo2mass;
-		projcolormod = self.iteminfo_ammo2colormod;
+		shotdir = self.weapinfo_ammo2speeds;
+		shotdamage = self.weapinfo_ammo2damage;
+		shotdamagetype = self.weapinfo_ammo2damagetype;
+		shotlifetime = self.weapinfo_ammo2lifetime;
+		shotprojflags = self.weapinfo_ammo2projflags;
+		shotfireflags = self.weapinfo_ammo2fireflags;
+		shotexplflags = self.weapinfo_ammo2explflags;
+		shottrailflags = self.weapinfo_ammo2trailflags;
+		shoteffectflags = self.weapinfo_ammo2effectflags;
+		shotmodel = self.weapinfo_ammo2model;
+		shotfiresound = self.weapinfo_ammo2firesound;
+		shotexplodesound = self.weapinfo_ammo2explodesound;
+		shotbouncesound = self.weapinfo_ammo2bouncesound;
+		numberof = self.weapinfo_ammo2numberof;
+		recoil = self.weapinfo_ammo2recoil;
+		mintofire = self.weapinfo_ammo2minimumtofire;
+		tracer = self.weapinfo_ammo2tracer;
+		tracermodel = self.weapinfo_ammo2tracermodel;
+		modelscale = self.weapinfo_ammo2modelscale;
+		projhealth = self.weapinfo_ammo2health;
+		projmass = self.weapinfo_ammo2mass;
+		projcolormod = self.weapinfo_ammo2colormod;
 	}
 	else
 	{
 		shotorg = muzzle1tagorigin;
-		shotdir = self.iteminfo_ammo1speeds;
-		shotdamage = self.iteminfo_ammo1damage;
-		shotdamagetype = self.iteminfo_ammo1damagetype;
-		shotlifetime = self.iteminfo_ammo1lifetime;
-		shotprojflags = self.iteminfo_ammo1projflags;
-		shotfireflags = self.iteminfo_ammo1fireflags;
-		shotexplflags = self.iteminfo_ammo1explflags;
-		shottrailflags = self.iteminfo_ammo1trailflags;
-		shoteffectflags = self.iteminfo_ammo1effectflags;
-		shotmodel = self.iteminfo_ammo1model;
-		shotfiresound = self.iteminfo_ammo1firesound;
-		shotexplodesound = self.iteminfo_ammo1explodesound;
-		shotbouncesound = self.iteminfo_ammo1bouncesound;
-		numberof = self.iteminfo_ammo1numberof;
-		recoil = self.iteminfo_ammo1recoil;
-		mintofire = self.iteminfo_ammo1minimumtofire;
-		tracer = self.iteminfo_ammo1tracer;
-		tracermodel = self.iteminfo_ammo1tracermodel;
-		modelscale = self.iteminfo_ammo1modelscale;
-		projhealth = self.iteminfo_ammo1health;
-		projmass = self.iteminfo_ammo1mass;
-		projcolormod = self.iteminfo_ammo1colormod;
+		shotdir = self.weapinfo_ammo1speeds;
+		shotdamage = self.weapinfo_ammo1damage;
+		shotdamagetype = self.weapinfo_ammo1damagetype;
+		shotlifetime = self.weapinfo_ammo1lifetime;
+		shotprojflags = self.weapinfo_ammo1projflags;
+		shotfireflags = self.weapinfo_ammo1fireflags;
+		shotexplflags = self.weapinfo_ammo1explflags;
+		shottrailflags = self.weapinfo_ammo1trailflags;
+		shoteffectflags = self.weapinfo_ammo1effectflags;
+		shotmodel = self.weapinfo_ammo1model;
+		shotfiresound = self.weapinfo_ammo1firesound;
+		shotexplodesound = self.weapinfo_ammo1explodesound;
+		shotbouncesound = self.weapinfo_ammo1bouncesound;
+		numberof = self.weapinfo_ammo1numberof;
+		recoil = self.weapinfo_ammo1recoil;
+		mintofire = self.weapinfo_ammo1minimumtofire;
+		tracer = self.weapinfo_ammo1tracer;
+		tracermodel = self.weapinfo_ammo1tracermodel;
+		modelscale = self.weapinfo_ammo1modelscale;
+		projhealth = self.weapinfo_ammo1health;
+		projmass = self.weapinfo_ammo1mass;
+		projcolormod = self.weapinfo_ammo1colormod;
 	}
 
 	if (self.unlimitedinventory == 0)
-	if (self.iteminfo_ammotype < ITEMTYPE_AMMO1) // then it's an item
+	if (self.weapinfo_ammotype < weaptype_AMMO1) // then it's an item
 	{
 	   Inventory_ModifyItem(self, self.itemselected, 0 - mintofire, 0);
 	}
 	else
 	{
 	   Inventory_ModifyItem(self, self.weaponitem, 0, 0 - mintofire);
-	   if (((self.currentammo + self.iteminfo_ammoinventory) < mintofire) && (self.iteminfo_removewhennoammo))
+	   if (((self.currentammo + self.weapinfo_ammoinventory) < mintofire) && (self.weapinfo_removewhennoammo))
 	   {
 			Inventory_ModifyItem(self, self.weaponitem, 0 - 1, 0);
 	   }
@@ -537,16 +537,16 @@
 
 
 // only called at spawn
-void(entity character, float weaponitemtype) weapon_setup =
+void(entity character, float weaponweaptype) weapon_setup =
 {
-	Inventory_GetItemInfo(character, weaponitemtype);
-	self.weaponitem = weaponitemtype;
+	Inventory_Getweapinfo(character, weaponweaptype);
+	self.weaponitem = weaponweaptype;
 	self.switchweaponitem = self.weaponitem;
 	
-	actor_setweaponmodel(character.iteminfo_model, character.iteminfo_weapon_viewmodel);
-	actor_setviewmodeloffset(character.iteminfo_viewmodeloffset);
-	character.viewmodelchange = character.iteminfo_viewmodeloffset;
-	//self.actorpart_weapon.scale = character.iteminfo_modelscale;
+	actor_setweaponmodel(character.weapinfo_model, character.weapinfo_weapon_viewmodel);
+	actor_setviewmodeloffset(character.weapinfo_viewmodeloffset);
+	character.viewmodelchange = character.weapinfo_viewmodeloffset;
+	//self.actorpart_weapon.scale = character.weapinfo_modelscale;
 	
 	weapon_state(WS_IDLE);
 };

Modified: trunk/progsqc/bots.qc
===================================================================
--- trunk/progsqc/bots.qc	2008-10-20 15:05:46 UTC (rev 130)
+++ trunk/progsqc/bots.qc	2008-12-12 23:17:02 UTC (rev 131)
@@ -155,8 +155,8 @@
 				return;
 			}
 
-			//Inventory_GetItemInfo(self, self.itemselected);
-			//if (character.iteminfo_ammo1fireflags & FIREFLAG_JETPACK)
+			//Inventory_Getweapinfo(self, self.itemselected);
+			//if (character.weapinfo_ammo1fireflags & FIREFLAG_JETPACK)
 			//{
 			//	self.button7 = 1;
 			//}
@@ -166,11 +166,11 @@
 
 		 	//ai_strafe();
 
-			//Inventory_GetItemInfo(self, self.weaponitem);
+			//Inventory_Getweapinfo(self, self.weaponitem);
 			if (!self.weapon_canfire1)
 			if (!self.weapon_canfire2)
 			{
-				//if (character.iteminfo_weapon_canreload)
+				//if (character.weapinfo_weapon_canreload)
 				//	self.button4 = 1;
 				//else
 					self.switchweaponitem = Inventory_GetBestWeapon(self);

Modified: trunk/progsqc/gamedefs.qc
===================================================================
--- trunk/progsqc/gamedefs.qc	2008-10-20 15:05:46 UTC (rev 130)
+++ trunk/progsqc/gamedefs.qc	2008-12-12 23:17:02 UTC (rev 131)
@@ -5,7 +5,7 @@
 
 .float respawntime;
 
-.float itemitemtype;
+.float itemweaptype;
 
 .float projflag;
 .float explflag;

Modified: trunk/progsqc/inventory.qc
===================================================================
--- trunk/progsqc/inventory.qc	2008-10-20 15:05:46 UTC (rev 130)
+++ trunk/progsqc/inventory.qc	2008-12-12 23:17:02 UTC (rev 131)
@@ -2,45 +2,45 @@
 // if TRUE this entity will ignore ModifyItem attempts with negative values
 .float unlimitedinventory;
 
-float ITEMTYPE_NONE = -1;
+float weaptype_NONE = -1;
 
-float ITEMTYPE_WEAP1 = 0;
-float ITEMTYPE_WEAP2 = 1;
-float ITEMTYPE_WEAP3 = 2;
-float ITEMTYPE_WEAP4 = 3;
-float ITEMTYPE_WEAP5 = 4;
-float ITEMTYPE_WEAP6 = 5;
-float ITEMTYPE_WEAP7 = 6;
-float ITEMTYPE_WEAP8 = 7;
-float ITEMTYPE_WEAP9 = 8;
-float ITEMTYPE_WEAP10 = 9;
-float ITEMTYPE_WEAP11 = 10;
-float ITEMTYPE_WEAP12 = 11;
-float ITEMTYPE_WEAP13 = 12;
-float ITEMTYPE_WEAP14 = 13;
-float ITEMTYPE_WEAP15 = 14;
-float ITEMTYPE_WEAP16 = 15;
+float weaptype_WEAP1 = 0;
+float weaptype_WEAP2 = 1;
+float weaptype_WEAP3 = 2;
+float weaptype_WEAP4 = 3;
+float weaptype_WEAP5 = 4;
+float weaptype_WEAP6 = 5;
+float weaptype_WEAP7 = 6;
+float weaptype_WEAP8 = 7;
+float weaptype_WEAP9 = 8;
+float weaptype_WEAP10 = 9;
+float weaptype_WEAP11 = 10;
+float weaptype_WEAP12 = 11;
+float weaptype_WEAP13 = 12;
+float weaptype_WEAP14 = 13;
+float weaptype_WEAP15 = 14;
+float weaptype_WEAP16 = 15;
 
-float ITEMTYPE_AI_WEAP1 = 16;
-float ITEMTYPE_AI_WEAP2 = 17;
-float ITEMTYPE_AI_WEAP3 = 18;
-float ITEMTYPE_AI_WEAP4 = 19;
-float ITEMTYPE_AI_WEAP5 = 20;
-float ITEMTYPE_AI_WEAP6 = 21;
-float ITEMTYPE_AI_WEAP7 = 22;
+float weaptype_AI_WEAP1 = 16;
+float weaptype_AI_WEAP2 = 17;
+float weaptype_AI_WEAP3 = 18;
+float weaptype_AI_WEAP4 = 19;
+float weaptype_AI_WEAP5 = 20;
+float weaptype_AI_WEAP6 = 21;
+float weaptype_AI_WEAP7 = 22;
 
-float ITEMTYPE_ITEM1 = 23;
-float ITEMTYPE_ITEM2 = 24;
-float ITEMTYPE_ITEM3 = 25;
-float ITEMTYPE_ITEM4 = 26;
-float ITEMTYPE_ITEM5 = 27;
+float weaptype_ITEM1 = 23;
+float weaptype_ITEM2 = 24;
+float weaptype_ITEM3 = 25;
+float weaptype_ITEM4 = 26;
+float weaptype_ITEM5 = 27;
 
-float ITEMTYPE_AMMO1 = 28;
-float ITEMTYPE_AMMO2 = 29;
-float ITEMTYPE_AMMO3 = 30;
-float ITEMTYPE_AMMO4 = 31;
+float weaptype_AMMO1 = 28;
+float weaptype_AMMO2 = 29;
+float weaptype_AMMO3 = 30;
+float weaptype_AMMO4 = 31;
 
-float ITEMTYPE_TOTAL = 32;
+float weaptype_TOTAL = 32;
 
 float WS_IDLE = 0;
 float WS_FIRE1 = 1;
@@ -56,381 +56,381 @@
 .float weaponstate;
 .float switchweaponitem;
 
-// current item stats
-.float iteminfo_quantity;
-.float iteminfo_ammo;
-.float iteminfo_ammoinventory; // how much ammo is in inventory (can be loaded into the gun)
+// current weapon stats
+.float weapinfo_quantity;
+.float weapinfo_ammo;
+.float weapinfo_ammoinventory; // how much ammo is in inventory (can be loaded into the gun)
 
-// general information about the item
-.string iteminfo_model;
-.string iteminfo_pickupsound;
-.string iteminfo_pickupmodel;
-.vector iteminfo_viewmodeloffset;
-.string iteminfo_name;
-.float iteminfo_removewhennoammo;
-.float iteminfo_itemtype;
-.float iteminfo_quantitymax;
-.float iteminfo_rechargerate;
-.float iteminfo_ammomax;
-.float iteminfo_ammoinventorymax;
-.float iteminfo_ammotype;
-.float iteminfo_modelscale;
-.vector iteminfo_modelcolormod;
+// general information about the weapon
+.string weapinfo_model;
+.string weapinfo_pickupsound;
+.string weapinfo_pickupmodel;
+.vector weapinfo_viewmodeloffset;
+.string weapinfo_name;
+.float weapinfo_removewhennoammo;
+.float weapinfo_weaptype;
+.float weapinfo_quantitymax;
+.float weapinfo_rechargerate;
+.float weapinfo_ammomax;
+.float weapinfo_ammoinventorymax;
+.float weapinfo_ammotype;
+.float weapinfo_modelscale;
+.vector weapinfo_modelcolormod;
 
-.float iteminfo_ammo1minimumtofire;
-.float iteminfo_ammo2minimumtofire;
-.float iteminfo_ammo1numberof;
-.float iteminfo_ammo2numberof;
-.float iteminfo_ammo1recoil;
-.float iteminfo_ammo2recoil;
-.vector iteminfo_ammo1damage;
-.vector iteminfo_ammo2damage;
-.float iteminfo_ammo1damagetype;
-.float iteminfo_ammo2damagetype;
-.vector iteminfo_ammo1speeds;
-.vector iteminfo_ammo2speeds;
-.float iteminfo_ammo1lifetime;
-.float iteminfo_ammo2lifetime;
-.float iteminfo_ammo1fireflags;
-.float iteminfo_ammo2fireflags;
-.float iteminfo_ammo1projflags;
-.float iteminfo_ammo2projflags;
-.float iteminfo_ammo1explflags;
-.float iteminfo_ammo2explflags;
-.float iteminfo_ammo1trailflags;
-.float iteminfo_ammo2trailflags;
-.float iteminfo_ammo1effectflags;
-.float iteminfo_ammo2effectflags;
-.string iteminfo_ammo1model;
-.string iteminfo_ammo2model;
-.string iteminfo_ammo1explodesound;
-.string iteminfo_ammo2explodesound;
-.string iteminfo_ammo1bouncesound;
-.string iteminfo_ammo2bouncesound;
-.string iteminfo_ammo1firesound;
-.string iteminfo_ammo2firesound;
-.float iteminfo_ammo1tracer;
-.float iteminfo_ammo2tracer;
-.string iteminfo_ammo1tracermodel;
-.string iteminfo_ammo2tracermodel;
-.float iteminfo_ammo1modelscale;
-.float iteminfo_ammo2modelscale;
-.float iteminfo_ammo1health;
-.float iteminfo_ammo2health;
-.float iteminfo_ammo1mass;
-.float iteminfo_ammo2mass;
-.vector iteminfo_ammo1colormod;
-.vector iteminfo_ammo2colormod;
-.vector iteminfo_ammo1viewmodelpush;
-.vector iteminfo_ammo2viewmodelpush;
-.float iteminfo_ammo1noprojectile;
-.float iteminfo_ammo2noprojectile;
+.float weapinfo_ammo1minimumtofire;
+.float weapinfo_ammo2minimumtofire;
+.float weapinfo_ammo1numberof;
+.float weapinfo_ammo2numberof;
+.float weapinfo_ammo1recoil;
+.float weapinfo_ammo2recoil;
+.vector weapinfo_ammo1damage;
+.vector weapinfo_ammo2damage;
+.float weapinfo_ammo1damagetype;
+.float weapinfo_ammo2damagetype;
+.vector weapinfo_ammo1speeds;
+.vector weapinfo_ammo2speeds;
+.float weapinfo_ammo1lifetime;
+.float weapinfo_ammo2lifetime;
+.float weapinfo_ammo1fireflags;
+.float weapinfo_ammo2fireflags;
+.float weapinfo_ammo1projflags;
+.float weapinfo_ammo2projflags;
+.float weapinfo_ammo1explflags;
+.float weapinfo_ammo2explflags;
+.float weapinfo_ammo1trailflags;
+.float weapinfo_ammo2trailflags;
+.float weapinfo_ammo1effectflags;
+.float weapinfo_ammo2effectflags;
+.string weapinfo_ammo1model;
+.string weapinfo_ammo2model;
+.string weapinfo_ammo1explodesound;
+.string weapinfo_ammo2explodesound;
+.string weapinfo_ammo1bouncesound;
+.string weapinfo_ammo2bouncesound;
+.string weapinfo_ammo1firesound;
+.string weapinfo_ammo2firesound;
+.float weapinfo_ammo1tracer;
+.float weapinfo_ammo2tracer;
+.string weapinfo_ammo1tracermodel;
+.string weapinfo_ammo2tracermodel;
+.float weapinfo_ammo1modelscale;
+.float weapinfo_ammo2modelscale;
+.float weapinfo_ammo1health;
+.float weapinfo_ammo2health;
+.float weapinfo_ammo1mass;
+.float weapinfo_ammo2mass;
+.vector weapinfo_ammo1colormod;
+.vector weapinfo_ammo2colormod;
+.vector weapinfo_ammo1viewmodelpush;
+.vector weapinfo_ammo2viewmodelpush;
+.float weapinfo_ammo1noprojectile;
+.float weapinfo_ammo2noprojectile;
 
 // special information specific to weapon items
-.string iteminfo_weapon_viewmodel;
-.vector iteminfo_weapon_viewmodelanim_idle;
-.vector iteminfo_weapon_viewmodelanim_fire1;
-.vector iteminfo_weapon_viewmodelanim_fire2;
-.vector iteminfo_weapon_viewmodelanim_reload;
-.vector iteminfo_weapon_viewmodelanim_lower;
-.vector iteminfo_weapon_viewmodelanim_raise;
-.vector iteminfo_weapon_viewmodelanim_turnon;
-.vector iteminfo_weapon_viewmodelanim_turnoff;
-.float iteminfo_weapon_canreload;
-.float iteminfo_weapon_canraise;
-.float iteminfo_weapon_rank;
+.string weapinfo_weapon_viewmodel;
+.vector weapinfo_weapon_viewmodelanim_idle;
+.vector weapinfo_weapon_viewmodelanim_fire1;
+.vector weapinfo_weapon_viewmodelanim_fire2;
+.vector weapinfo_weapon_viewmodelanim_reload;
+.vector weapinfo_weapon_viewmodelanim_lower;
+.vector weapinfo_weapon_viewmodelanim_raise;
+.vector weapinfo_weapon_viewmodelanim_turnon;
+.vector weapinfo_weapon_viewmodelanim_turnoff;
+.float weapinfo_weapon_canreload;
+.float weapinfo_weapon_canraise;
+.float weapinfo_weapon_rank;
 
 // this array and functions depend on fteqcc arrays, but are easily replaced with a huge chunk of if else stuff if needed
-.vector inventory[ITEMTYPE_TOTAL];
-vector(entity character, float itemtype) Inventory_GetItem =
+.vector inventory[weaptype_TOTAL];
+vector(entity character, float weaptype) Inventory_GetItem =
 {
-	if (itemtype < 0 || itemtype >= ITEMTYPE_TOTAL)
+	if (weaptype < 0 || weaptype >= weaptype_TOTAL)
 		return '0 0 0';
-	return character.(inventory[itemtype]);
+	return character.(inventory[weaptype]);
 };
-void(entity character, float itemtype, vector item) Inventory_SetItem =
+void(entity character, float weaptype, vector item) Inventory_SetItem =
 {
-	if (itemtype < 0 || itemtype >= ITEMTYPE_TOTAL)
+	if (weaptype < 0 || weaptype >= weaptype_TOTAL)
 		return;
-	character.(inventory[itemtype]) = item;
+	character.(inventory[weaptype]) = item;
 };
-void(entity character, float itemtype) Inventory_GetItemInfo =
+void(entity character, float weaptype) Inventory_Getweapinfo =
 {
 	local vector item;
 	local entity e;
 	local float d;
-	//bprint(ftos(itemtype)," : ",character.model,"\n");
-	if (itemtype < 0)
+	//bprint(ftos(weaptype)," : ",character.model,"\n");
+	if (weaptype < 0)
 	{
-	    bprint(character.iteminfo_name);
-		//error("itemtype = ",ftos(itemtype),"\n");
+	    bprint(character.weapinfo_name);
+		//error("weaptype = ",ftos(weaptype),"\n");
 	}
-	if (itemtype >= ITEMTYPE_TOTAL)
-		bprint(ftos(itemtype)," ", ftos(ITEMTYPE_TOTAL), " : itemtype >= ITEMTYPE_TOTAL\n");
-	character.iteminfo_itemtype = itemtype;
-	item = Inventory_GetItem(character, itemtype);
-	character.iteminfo_quantity = item_x;
-	character.iteminfo_ammo = item_y;
-	character.iteminfo_ammoinventory = 0;
+	if (weaptype >= weaptype_TOTAL)
+		bprint(ftos(weaptype)," ", ftos(weaptype_TOTAL), " : weaptype >= weaptype_TOTAL\n");
+	character.weapinfo_weaptype = weaptype;
+	item = Inventory_GetItem(character, weaptype);
+	character.weapinfo_quantity = item_x;
+	character.weapinfo_ammo = item_y;
+	character.weapinfo_ammoinventory = 0;
 	
-	character.iteminfo_model = "";
-	character.iteminfo_modelcolormod = '1 1 1';
-	character.iteminfo_pickupmodel = "";
-	character.iteminfo_viewmodeloffset = '0 0 0';
-	character.iteminfo_name = "unknown";
-	character.iteminfo_pickupsound = "";
-	character.iteminfo_removewhennoammo = 0;
-	character.iteminfo_quantitymax = 0;
-	character.iteminfo_rechargerate = 0;
-	character.iteminfo_ammomax = 0;
-	character.iteminfo_ammoinventorymax = 0;
-	character.iteminfo_ammotype = ITEMTYPE_NONE;
+	character.weapinfo_model = "";
+	character.weapinfo_modelcolormod = '1 1 1';
+	character.weapinfo_pickupmodel = "";
+	character.weapinfo_viewmodeloffset = '0 0 0';
+	character.weapinfo_name = "unknown";
+	character.weapinfo_pickupsound = "";
+	character.weapinfo_removewhennoammo = 0;
+	character.weapinfo_quantitymax = 0;
+	character.weapinfo_rechargerate = 0;
+	character.weapinfo_ammomax = 0;
+	character.weapinfo_ammoinventorymax = 0;
+	character.weapinfo_ammotype = weaptype_NONE;
 	
-	character.iteminfo_ammo1minimumtofire = 0;
-	character.iteminfo_ammo1damagetype = DAMAGETYPE_UNKNOWN;
-	character.iteminfo_ammo1damage = '0 0 0';
-	character.iteminfo_ammo1speeds = '0 0 0';
-	character.iteminfo_ammo1lifetime = 10;
-	character.iteminfo_ammo1projflags = PROJFLAG_ANYIMPACT;
-	character.iteminfo_ammo1explflags = 0;
-	character.iteminfo_ammo1trailflags = 0;
-	character.iteminfo_ammo1effectflags = 0;
-	character.iteminfo_ammo1fireflags = 0;
-	character.iteminfo_ammo1model = "";
-	character.iteminfo_ammo1firesound = "";
-	character.iteminfo_ammo1explodesound = "";
-	character.iteminfo_ammo1bouncesound = "";
-	character.iteminfo_ammo1numberof = 1;
-	character.iteminfo_ammo1recoil = 0;
-	character.iteminfo_ammo1tracer = 0;
-	character.iteminfo_ammo1tracermodel = "";
-	character.iteminfo_ammo1modelscale = 1;
-	character.iteminfo_ammo1health = 0;
-	character.iteminfo_ammo1mass = 0;
-	character.iteminfo_ammo1colormod = '0 0 0';
-	character.iteminfo_ammo1viewmodelpush = '0 0 0';
-	character.iteminfo_ammo1noprojectile = 0;
-	character.iteminfo_ammo2minimumtofire = 0;
-	character.iteminfo_ammo2damagetype = DAMAGETYPE_UNKNOWN;
-	character.iteminfo_ammo2damage = '0 0 0';
-	character.iteminfo_ammo2speeds = '0 0 0';
-	character.iteminfo_ammo2lifetime = 10;
-	character.iteminfo_ammo2projflags = PROJFLAG_ANYIMPACT;
-	character.iteminfo_ammo2explflags = 0;
-	character.iteminfo_ammo2trailflags = 0;
-	character.iteminfo_ammo2effectflags = 0;
-	character.iteminfo_ammo2fireflags = 0;
-	character.iteminfo_ammo2model = "";
-	character.iteminfo_ammo2firesound = "";
-	character.iteminfo_ammo2explodesound = "";
-	character.iteminfo_ammo2bouncesound = "";
-	character.iteminfo_ammo2numberof = 1;
-	character.iteminfo_ammo2recoil = 0;
-	character.iteminfo_ammo2tracer = 0;
-	character.iteminfo_ammo2tracermodel = "";
-	character.iteminfo_ammo2modelscale = 1;
-	character.iteminfo_ammo2health = 0;
-	character.iteminfo_ammo2mass = 0;
-	character.iteminfo_ammo2colormod = '0 0 0';
-	character.iteminfo_ammo2viewmodelpush =  '0 0 0';
-	character.iteminfo_ammo2noprojectile = 0;
-	character.iteminfo_weapon_viewmodel = "";
-	character.iteminfo_weapon_viewmodelanim_idle = '0 0 1';
-	character.iteminfo_weapon_viewmodelanim_fire1 = '0 0 2';
-	character.iteminfo_weapon_viewmodelanim_fire2 = '0 0 2';
-	character.iteminfo_weapon_viewmodelanim_reload = '0 0 0';
-	character.iteminfo_weapon_viewmodelanim_lower = '0 0 2';
-	character.iteminfo_weapon_viewmodelanim_raise = '0 0 2';
-	character.iteminfo_weapon_viewmodelanim_turnon = '0 0 2';
-	character.iteminfo_weapon_viewmodelanim_turnoff = '0 0 2';
-	character.iteminfo_weapon_canreload = FALSE;
-	character.iteminfo_weapon_canraise = FALSE;
-	character.iteminfo_weapon_rank = 0;
+	character.weapinfo_ammo1minimumtofire = 0;
+	character.weapinfo_ammo1damagetype = DAMAGETYPE_UNKNOWN;
+	character.weapinfo_ammo1damage = '0 0 0';
+	character.weapinfo_ammo1speeds = '0 0 0';
+	character.weapinfo_ammo1lifetime = 10;
+	character.weapinfo_ammo1projflags = PROJFLAG_ANYIMPACT;
+	character.weapinfo_ammo1explflags = 0;
+	character.weapinfo_ammo1trailflags = 0;
+	character.weapinfo_ammo1effectflags = 0;
+	character.weapinfo_ammo1fireflags = 0;
+	character.weapinfo_ammo1model = "";
+	character.weapinfo_ammo1firesound = "";
+	character.weapinfo_ammo1explodesound = "";
+	character.weapinfo_ammo1bouncesound = "";
+	character.weapinfo_ammo1numberof = 1;
+	character.weapinfo_ammo1recoil = 0;
+	character.weapinfo_ammo1tracer = 0;
+	character.weapinfo_ammo1tracermodel = "";
+	character.weapinfo_ammo1modelscale = 1;
+	character.weapinfo_ammo1health = 0;
+	character.weapinfo_ammo1mass = 0;
+	character.weapinfo_ammo1colormod = '0 0 0';
+	character.weapinfo_ammo1viewmodelpush = '0 0 0';
+	character.weapinfo_ammo1noprojectile = 0;
+	character.weapinfo_ammo2minimumtofire = 0;
+	character.weapinfo_ammo2damagetype = DAMAGETYPE_UNKNOWN;
+	character.weapinfo_ammo2damage = '0 0 0';
+	character.weapinfo_ammo2speeds = '0 0 0';
+	character.weapinfo_ammo2lifetime = 10;
+	character.weapinfo_ammo2projflags = PROJFLAG_ANYIMPACT;
+	character.weapinfo_ammo2explflags = 0;
+	character.weapinfo_ammo2trailflags = 0;
+	character.weapinfo_ammo2effectflags = 0;
+	character.weapinfo_ammo2fireflags = 0;
+	character.weapinfo_ammo2model = "";
+	character.weapinfo_ammo2firesound = "";
+	character.weapinfo_ammo2explodesound = "";
+	character.weapinfo_ammo2bouncesound = "";
+	character.weapinfo_ammo2numberof = 1;
+	character.weapinfo_ammo2recoil = 0;
+	character.weapinfo_ammo2tracer = 0;
+	character.weapinfo_ammo2tracermodel = "";
+	character.weapinfo_ammo2modelscale = 1;
+	character.weapinfo_ammo2health = 0;
+	character.weapinfo_ammo2mass = 0;
+	character.weapinfo_ammo2colormod = '0 0 0';
+	character.weapinfo_ammo2viewmodelpush =  '0 0 0';
+	character.weapinfo_ammo2noprojectile = 0;
+	character.weapinfo_weapon_viewmodel = "";
+	character.weapinfo_weapon_viewmodelanim_idle = '0 0 1';
+	character.weapinfo_weapon_viewmodelanim_fire1 = '0 0 2';
+	character.weapinfo_weapon_viewmodelanim_fire2 = '0 0 2';
+	character.weapinfo_weapon_viewmodelanim_reload = '0 0 0';
+	character.weapinfo_weapon_viewmodelanim_lower = '0 0 2';
+	character.weapinfo_weapon_viewmodelanim_raise = '0 0 2';
+	character.weapinfo_weapon_viewmodelanim_turnon = '0 0 2';
+	character.weapinfo_weapon_viewmodelanim_turnoff = '0 0 2';
+	character.weapinfo_weapon_canreload = FALSE;
+	character.weapinfo_weapon_canraise = FALSE;
+	character.weapinfo_weapon_rank = 0;
 
 	character.weapon_canfire1 = FALSE;
 	character.weapon_canfire2 = FALSE;	
 	
-	if (itemtype < ITEMTYPE_AMMO1)
+	if (weaptype < weaptype_AMMO1)
 	{
 	   	// set the settings for all weapons		  
-		character.iteminfo_quantitymax = 1;
-		character.iteminfo_pickupsound = "items/pickupweapon.wav";
-		character.iteminfo_weapon_viewmodelanim_idle = '0 0 30';
-		character.iteminfo_weapon_viewmodelanim_lower = '0 0 0';
-		character.iteminfo_weapon_viewmodelanim_raise = '0 0 0';
+		character.weapinfo_quantitymax = 1;
+		character.weapinfo_pickupsound = "items/pickupweapon.wav";
+		character.weapinfo_weapon_viewmodelanim_idle = '0 0 30';
+		character.weapinfo_weapon_viewmodelanim_lower = '0 0 0';
+		character.weapinfo_weapon_viewmodelanim_raise = '0 0 0';
 		
 		string wname;
-		if (itemtype < ITEMTYPE_AI_WEAP1)
+		if (weaptype < weaptype_AI_WEAP1)
 		{
-		   wname = strcat("g_weap",ftos(itemtype + 1));
-		   character.iteminfo_ammotype = cvar(wname,"_ammotype") + ITEMTYPE_AMMO1 - 1;
+		   wname = strcat("g_weap",ftos(weaptype + 1));
+		   character.weapinfo_ammotype = cvar(wname,"_ammotype") + weaptype_AMMO1 - 1;
 		}
-		else if (itemtype < ITEMTYPE_ITEM1)
+		else if (weaptype < weaptype_ITEM1)
 		{
-		   wname = strcat("g_ai_weap",ftos(itemtype - ITEMTYPE_AI_WEAP1 + 1)); 
-		   character.iteminfo_ammotype = cvar(wname,"_ammotype") + ITEMTYPE_AMMO1 - 1;
+		   wname = strcat("g_ai_weap",ftos(weaptype - weaptype_AI_WEAP1 + 1)); 
+		   character.weapinfo_ammotype = cvar(wname,"_ammotype") + weaptype_AMMO1 - 1;
 		}
 		else
 		{
-	 		wname = strcat("g_item",ftos(itemtype - ITEMTYPE_ITEM1 + 1)); 
-		 	character.iteminfo_quantitymax = cvar(wname,"_quantitymax");
-			character.iteminfo_ammotype = itemtype;					  // so the firing code knows it's a item
+	 		wname = strcat("g_item",ftos(weaptype - weaptype_ITEM1 + 1)); 
+		 	character.weapinfo_quantitymax = cvar(wname,"_quantitymax");
+			character.weapinfo_ammotype = weaptype;					  // so the firing code knows it's a item
 		}
 		
-		character.iteminfo_ammo1damagetype = DAMAGETYPE_WEAP1 + itemtype;
-		character.iteminfo_ammo2damagetype = DAMAGETYPE_WEAP1 + itemtype;
+		character.weapinfo_ammo1damagetype = DAMAGETYPE_WEAP1 + weaptype;
+		character.weapinfo_ammo2damagetype = DAMAGETYPE_WEAP1 + weaptype;
 		
-		character.iteminfo_name = cvar_string(wname);
-		character.iteminfo_model = cvar_string(wname,"_model");
-		character.iteminfo_weapon_viewmodel = cvar_string(wname,"_viewmodel");
-		character.iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
-		character.iteminfo_viewmodeloffset = stov(cvar_string(wname,"_viewmodeloffset"));
-		character.iteminfo_modelcolormod = stov(cvar_string(wname,"_modelcolormod"));
+		character.weapinfo_name = cvar_string(wname);
+		character.weapinfo_model = cvar_string(wname,"_model");
+		character.weapinfo_weapon_viewmodel = cvar_string(wname,"_viewmodel");
+		character.weapinfo_pickupmodel = cvar_string(wname,"_pickupmodel");
+		character.weapinfo_viewmodeloffset = stov(cvar_string(wname,"_viewmodeloffset"));
+		character.weapinfo_modelcolormod = stov(cvar_string(wname,"_modelcolormod"));
 
-		character.iteminfo_removewhennoammo = cvar(wname,"_removewhennoammo");
+		character.weapinfo_removewhennoammo = cvar(wname,"_removewhennoammo");
 		
-		character.iteminfo_rechargerate = cvar(wname,"_rechargerate");
+		character.weapinfo_rechargerate = cvar(wname,"_rechargerate");
 
-		character.iteminfo_modelscale = cvar(wname,"_modelscale");
+		character.weapinfo_modelscale = cvar(wname,"_modelscale");
 		
-		character.iteminfo_ammomax = cvar(wname,"_ammomax");
-		character.iteminfo_ammoinventorymax = cvar(wname,"_ammoinventorymax");
+		character.weapinfo_ammomax = cvar(wname,"_ammomax");
+		character.weapinfo_ammoinventorymax = cvar(wname,"_ammoinventorymax");
 		
-		character.iteminfo_ammo1damage = stov(cvar_string(wname,"_ammo1damage"));
-		character.iteminfo_ammo1speeds = stov(cvar_string(wname,"_ammo1speeds"));
-		character.iteminfo_ammo1model = cvar_string(wname,"_ammo1model");
-		character.iteminfo_ammo1firesound = cvar_string(wname,"_ammo1firesound");
-		//character.iteminfo_ammo1explodesound = strzone(cvar_string(wname,"_ammo1explodesound"));
+		character.weapinfo_ammo1damage = stov(cvar_string(wname,"_ammo1damage"));
+		character.weapinfo_ammo1speeds = stov(cvar_string(wname,"_ammo1speeds"));
+		character.weapinfo_ammo1model = cvar_string(wname,"_ammo1model");
+		character.weapinfo_ammo1firesound = cvar_string(wname,"_ammo1firesound");
+		//character.weapinfo_ammo1explodesound = strzone(cvar_string(wname,"_ammo1explodesound"));
 		
-		character.iteminfo_ammo1projflags = cvar(wname,"_ammo1projflags");
-		character.iteminfo_ammo1explflags = cvar(wname,"_ammo1explflags");
-		character.iteminfo_ammo1fireflags = cvar(wname,"_ammo1fireflags");
-		character.iteminfo_ammo1trailflags = cvar(wname,"_ammo1trailflags");
-		character.iteminfo_ammo1effectflags = cvar(wname,"_ammo1effectflags");
+		character.weapinfo_ammo1projflags = cvar(wname,"_ammo1projflags");
+		character.weapinfo_ammo1explflags = cvar(wname,"_ammo1explflags");
+		character.weapinfo_ammo1fireflags = cvar(wname,"_ammo1fireflags");
+		character.weapinfo_ammo1trailflags = cvar(wname,"_ammo1trailflags");
+		character.weapinfo_ammo1effectflags = cvar(wname,"_ammo1effectflags");
 		
-		character.iteminfo_ammo1noprojectile = cvar(wname,"_ammo1noprojectile");
+		character.weapinfo_ammo1noprojectile = cvar(wname,"_ammo1noprojectile");
 		
-		character.iteminfo_ammo1numberof = cvar(wname,"_ammo1numberof");
-		character.iteminfo_ammo1recoil = cvar(wname,"_ammo1recoil");
-		character.iteminfo_ammo1minimumtofire = cvar(wname,"_ammo1mintofire");
-		character.iteminfo_ammo1lifetime = cvar(wname,"_ammo1lifetime");
-		character.iteminfo_ammo1tracer = cvar(wname,"_ammo1tracer");
-		character.iteminfo_ammo1tracermodel = cvar_string(wname,"_ammo1tracermodel");
-		character.iteminfo_ammo1modelscale = cvar(wname,"_ammo1modelscale");
-		character.iteminfo_ammo1health = cvar(wname,"_ammo1health");
-		character.iteminfo_ammo1mass = cvar(wname,"_ammo1mass");
-		character.iteminfo_ammo1colormod = stov(cvar_string(wname,"_ammo1colormod"));
-		character.iteminfo_ammo1viewmodelpush = stov(cvar_string(wname,"_ammo1viewmodelpush"));
-		character.iteminfo_weapon_viewmodelanim_fire1 = stov(cvar_string(wname,"_fire1"));
+		character.weapinfo_ammo1numberof = cvar(wname,"_ammo1numberof");
+		character.weapinfo_ammo1recoil = cvar(wname,"_ammo1recoil");
+		character.weapinfo_ammo1minimumtofire = cvar(wname,"_ammo1mintofire");
+		character.weapinfo_ammo1lifetime = cvar(wname,"_ammo1lifetime");
+		character.weapinfo_ammo1tracer = cvar(wname,"_ammo1tracer");
+		character.weapinfo_ammo1tracermodel = cvar_string(wname,"_ammo1tracermodel");
+		character.weapinfo_ammo1modelscale = cvar(wname,"_ammo1modelscale");
+		character.weapinfo_ammo1health = cvar(wname,"_ammo1health");
+		character.weapinfo_ammo1mass = cvar(wname,"_ammo1mass");
+		character.weapinfo_ammo1colormod = stov(cvar_string(wname,"_ammo1colormod"));
+		character.weapinfo_ammo1viewmodelpush = stov(cvar_string(wname,"_ammo1viewmodelpush"));
+		character.weapinfo_weapon_viewmodelanim_fire1 = stov(cvar_string(wname,"_fire1"));
 		
-		character.iteminfo_ammo2damage = stov(cvar_string(wname,"_ammo2damage"));
-		character.iteminfo_ammo2speeds = stov(cvar_string(wname,"_ammo2speeds"));
-		character.iteminfo_ammo2model = cvar_string(wname,"_ammo2model");
-		character.iteminfo_ammo2firesound = cvar_string(wname,"_ammo2firesound");
-		//character.iteminfo_ammo2explodesound = strzone(cvar_string(wname,"_ammo2explodesound"));
+		character.weapinfo_ammo2damage = stov(cvar_string(wname,"_ammo2damage"));
+		character.weapinfo_ammo2speeds = stov(cvar_string(wname,"_ammo2speeds"));
+		character.weapinfo_ammo2model = cvar_string(wname,"_ammo2model");
+		character.weapinfo_ammo2firesound = cvar_string(wname,"_ammo2firesound");
+		//character.weapinfo_ammo2explodesound = strzone(cvar_string(wname,"_ammo2explodesound"));
 		
-		character.iteminfo_ammo2projflags = cvar(wname,"_ammo2projflags");
-		character.iteminfo_ammo2explflags = cvar(wname,"_ammo2explflags");
-		character.iteminfo_ammo2fireflags = cvar(wname,"_ammo2fireflags");
-		character.iteminfo_ammo2trailflags = cvar(wname,"_ammo2trailflags");
-		character.iteminfo_ammo2effectflags = cvar(wname,"_ammo2effectflags");
+		character.weapinfo_ammo2projflags = cvar(wname,"_ammo2projflags");
+		character.weapinfo_ammo2explflags = cvar(wname,"_ammo2explflags");
+		character.weapinfo_ammo2fireflags = cvar(wname,"_ammo2fireflags");
+		character.weapinfo_ammo2trailflags = cvar(wname,"_ammo2trailflags");
+		character.weapinfo_ammo2effectflags = cvar(wname,"_ammo2effectflags");
 		
-		character.iteminfo_ammo2noprojectile = cvar(wname,"_ammo2noprojectile");
+		character.weapinfo_ammo2noprojectile = cvar(wname,"_ammo2noprojectile");
 		
-		character.iteminfo_ammo2numberof = cvar(wname,"_ammo2numberof");
-		character.iteminfo_ammo2recoil = cvar(wname,"_ammo2recoil");
-		character.iteminfo_ammo2minimumtofire = cvar(wname,"_ammo2mintofire");
-		character.iteminfo_ammo2lifetime = cvar(wname,"_ammo2lifetime");
-		character.iteminfo_ammo2tracer = cvar(wname,"_ammo2tracer");
-		character.iteminfo_ammo2tracermodel = cvar_string(wname,"_ammo2tracermodel");
-		character.iteminfo_ammo2modelscale = cvar(wname,"_ammo2modelscale");
-		character.iteminfo_ammo2health = cvar(wname,"_ammo2health");
-		character.iteminfo_ammo2mass = cvar(wname,"_ammo2mass");
-		character.iteminfo_ammo2colormod = stov(cvar_string(wname,"_ammo2colormod"));
-		character.iteminfo_ammo2viewmodelpush = stov(cvar_string(wname,"_ammo2viewmodelpush"));
-		character.iteminfo_weapon_viewmodelanim_fire2 = stov(cvar_string(wname,"_fire2"));
+		character.weapinfo_ammo2numberof = cvar(wname,"_ammo2numberof");
+		character.weapinfo_ammo2recoil = cvar(wname,"_ammo2recoil");
+		character.weapinfo_ammo2minimumtofire = cvar(wname,"_ammo2mintofire");
+		character.weapinfo_ammo2lifetime = cvar(wname,"_ammo2lifetime");
+		character.weapinfo_ammo2tracer = cvar(wname,"_ammo2tracer");
+		character.weapinfo_ammo2tracermodel = cvar_string(wname,"_ammo2tracermodel");
+		character.weapinfo_ammo2modelscale = cvar(wname,"_ammo2modelscale");
+		character.weapinfo_ammo2health = cvar(wname,"_ammo2health");
+		character.weapinfo_ammo2mass = cvar(wname,"_ammo2mass");
+		character.weapinfo_ammo2colormod = stov(cvar_string(wname,"_ammo2colormod"));
+		character.weapinfo_ammo2viewmodelpush = stov(cvar_string(wname,"_ammo2viewmodelpush"));
+		character.weapinfo_weapon_viewmodelanim_fire2 = stov(cvar_string(wname,"_fire2"));
 	}
-	else if (itemtype < ITEMTYPE_TOTAL)
+	else if (weaptype < weaptype_TOTAL)
 	{
-		wname = strcat("g_ammo",ftos(itemtype - ITEMTYPE_AMMO1 + 1));
-		character.iteminfo_name = cvar_string(wname,"_name");
-		character.iteminfo_pickupsound = cvar_string(wname,"_pickupsound");
-		character.iteminfo_pickupmodel = cvar_string(wname,"_pickupmodel");
-		character.iteminfo_quantitymax = cvar(wname,"_quantitymax");
-		character.iteminfo_modelcolormod =  stov(cvar_string(wname,"_modelcolormod"));
+		wname = strcat("g_ammo",ftos(weaptype - weaptype_AMMO1 + 1));
+		character.weapinfo_name = cvar_string(wname,"_name");
+		character.weapinfo_pickupsound = cvar_string(wname,"_pickupsound");
+		character.weapinfo_pickupmodel = cvar_string(wname,"_pickupmodel");
+		character.weapinfo_quantitymax = cvar(wname,"_quantitymax");
+		character.weapinfo_modelcolormod =  stov(cvar_string(wname,"_modelcolormod"));
 	}
 	else
-		bprint(ftos(itemtype)," Inventory_GetItemInfo: unknown itemtype\n");
+		bprint(ftos(weaptype)," Inventory_Getweapinfo: unknown weaptype\n");
 	
-	if (character.iteminfo_quantity >= 1)
+	if (character.weapinfo_quantity >= 1)
 	{
-		if (character.iteminfo_ammotype == itemtype)
+		if (character.weapinfo_ammotype == weaptype)
 		{
 			// usable items such as flares
-			character.iteminfo_ammo1minimumtofire = 1;
-			character.iteminfo_ammomax = character.iteminfo_ammo1minimumtofire;
-			if (character.iteminfo_quantity >= character.iteminfo_ammo1minimumtofire)
+			character.weapinfo_ammo1minimumtofire = 1;
+			character.weapinfo_ammomax = character.weapinfo_ammo1minimumtofire;
+			if (character.weapinfo_quantity >= character.weapinfo_ammo1minimumtofire)
 			{
-				character.iteminfo_ammo = character.iteminfo_ammo1minimumtofire;
-				character.iteminfo_ammoinventory = character.iteminfo_quantity - character.iteminfo_ammo1minimumtofire;
+				character.weapinfo_ammo = character.weapinfo_ammo1minimumtofire;
+				character.weapinfo_ammoinventory = character.weapinfo_quantity - character.weapinfo_ammo1minimumtofire;
 				character.weapon_canfire1 = TRUE;
 				character.weapon_canfire2 = TRUE;
-				character.iteminfo_weapon_canraise = character.weapon_canfire1 || character.weapon_canfire2;
-				character.iteminfo_weapon_rank = character.iteminfo_quantity * character.iteminfo_ammo1damage_x;
+				character.weapinfo_weapon_canraise = character.weapon_canfire1 || character.weapon_canfire2;
+				character.weapinfo_weapon_rank = character.weapinfo_quantity * character.weapinfo_ammo1damage_x;
 			}
 		}
-		else if (character.iteminfo_ammo1minimumtofire >= 0)
+		else if (character.weapinfo_ammo1minimumtofire >= 0)
 		{
 			// weapons
-			if (character.iteminfo_ammotype >= 0)
+			if (character.weapinfo_ammotype >= 0)
 			{
-				item = Inventory_GetItem(character, character.iteminfo_ammotype);
-				character.iteminfo_ammoinventory = item_x;
+				item = Inventory_GetItem(character, character.weapinfo_ammotype);
+				character.weapinfo_ammoinventory = item_x;
 			}
-			character.iteminfo_weapon_canreload = (character.iteminfo_ammo < character.iteminfo_ammomax && character.iteminfo_ammoinventory >= 1);
-			character.weapon_canfire1 = character.iteminfo_ammo >= character.iteminfo_ammo1minimumtofire;
-			character.weapon_canfire2 = character.iteminfo_ammo >= character.iteminfo_ammo2minimumtofire;
+			character.weapinfo_weapon_canreload = (character.weapinfo_ammo < character.weapinfo_ammomax && character.weapinfo_ammoinventory >= 1);
+			character.weapon_canfire1 = character.weapinfo_ammo >= character.weapinfo_ammo1minimumtofire;
+			character.weapon_canfire2 = character.weapinfo_ammo >= character.weapinfo_ammo2minimumtofire;
 	
 			// fteqcc bug:
 			// these work
-			character.iteminfo_weapon_canraise = character.weapon_canfire1 + character.weapon_canfire2 + character.iteminfo_weapon_canreload;
-			//if (character.iteminfo_weapon_canfire1 || character.iteminfo_weapon_canfire2 || character.iteminfo_weapon_canreload)
-			//	character.iteminfo_weapon_canraise = TRUE;
+			character.weapinfo_weapon_canraise = character.weapon_canfire1 + character.weapon_canfire2 + character.weapinfo_weapon_canreload;
+			//if (character.weapinfo_weapon_canfire1 || character.weapinfo_weapon_canfire2 || character.weapinfo_weapon_canreload)
+			//	character.weapinfo_weapon_canraise = TRUE;
 			// these don't work
-			//character.iteminfo_weapon_canraise = character.iteminfo_weapon_canfire1 || (character.iteminfo_weapon_canfire2 || character.iteminfo_weapon_canreload);
-			//character.iteminfo_weapon_canraise = (character.iteminfo_weapon_canfire1 || character.iteminfo_weapon_canfire2) || character.iteminfo_weapon_canreload;
-			//character.iteminfo_weapon_canraise = character.iteminfo_weapon_canfire1 || character.iteminfo_weapon_canfire2 || character.iteminfo_weapon_canreload;
-			if (character.iteminfo_weapon_canraise)
-				character.iteminfo_weapon_rank = (character.iteminfo_ammo + character.iteminfo_ammoinventory) * character.iteminfo_ammo1damage_x + (character.iteminfo_ammo + character.iteminfo_ammoinventory) * character.iteminfo_ammo2damage_x;
+			//character.weapinfo_weapon_canraise = character.weapinfo_weapon_canfire1 || (character.weapinfo_weapon_canfire2 || character.weapinfo_weapon_canreload);
+			//character.weapinfo_weapon_canraise = (character.weapinfo_weapon_canfire1 || character.weapinfo_weapon_canfire2) || character.weapinfo_weapon_canreload;
+			//character.weapinfo_weapon_canraise = character.weapinfo_weapon_canfire1 || character.weapinfo_weapon_canfire2 || character.weapinfo_weapon_canreload;
+			if (character.weapinfo_weapon_canraise)
+				character.weapinfo_weapon_rank = (character.weapinfo_ammo + character.weapinfo_ammoinventory) * character.weapinfo_ammo1damage_x + (character.weapinfo_ammo + character.weapinfo_ammoinventory) * character.weapinfo_ammo2damage_x;
 		}
 		else
 		{
 			// ammo and other consumables, not usable
 		}
 	}
-	if (itemtype == character.weaponitem)
+	if (weaptype == character.weaponitem)
 	{
 		character.currentammo = 0;
 		character.ammo_shells = 0;
 		//character.ammo_nails = 0;
 		//character.ammo_rockets = 0;
-		character.ammo_cells = character.itemselected - ITEMTYPE_ITEM1 + 1;
-		if (!(character.iteminfo_ammotype == ITEMTYPE_AMMO1))		// infinite ammo
-		if (character.iteminfo_ammomax + character.iteminfo_ammoinventorymax)
+		character.ammo_cells = character.itemselected - weaptype_ITEM1 + 1;
+		if (!(character.weapinfo_ammotype == weaptype_AMMO1))		// infinite ammo
+		if (character.weapinfo_ammomax + character.weapinfo_ammoinventorymax)
 		{
-			character.currentammo = character.iteminfo_ammo * 200 / (character.iteminfo_ammomax + character.iteminfo_ammoinventorymax);
-			character.ammo_shells = character.iteminfo_ammoinventory * 200 / (character.iteminfo_ammomax + character.iteminfo_ammoinventorymax);
+			character.currentammo = character.weapinfo_ammo * 200 / (character.weapinfo_ammomax + character.weapinfo_ammoinventorymax);
+			character.ammo_shells = character.weapinfo_ammoinventory * 200 / (character.weapinfo_ammomax + character.weapinfo_ammoinventorymax);
 		}
 		// character.ammo_nails is now set above as the item quantity when using items
-		//if (character.iteminfo_ammo2max + character.iteminfo_ammo2inventorymax)
+		//if (character.weapinfo_ammo2max + character.weapinfo_ammo2inventorymax)
 		//{
-		//	character.ammo_nails = character.jetpack_fuel; // character.iteminfo_ammo2 * 200 / (character.iteminfo_ammo2max + character.iteminfo_ammo2inventorymax);
-		//	character.ammo_rockets = 0; //character.iteminfo_ammo2inventory * 200 / (character.iteminfo_ammo2max + character.iteminfo_ammo2inventorymax);
+		//	character.ammo_nails = character.jetpack_fuel; // character.weapinfo_ammo2 * 200 / (character.weapinfo_ammo2max + character.weapinfo_ammo2inventorymax);
+		//	character.ammo_rockets = 0; //character.weapinfo_ammo2inventory * 200 / (character.weapinfo_ammo2max + character.weapinfo_ammo2inventorymax);
 		//}
 	}
-	else if (itemtype == character.itemselected)
+	else if (weaptype == character.itemselected)
 	{
-	 	character.ammo_nails = character.iteminfo_quantity * 200 / (character.iteminfo_quantitymax);
+	 	character.ammo_nails = character.weapinfo_quantity * 200 / (character.weapinfo_quantitymax);
 	}
 };
 
@@ -438,22 +438,22 @@
 {
 	local float c;
 	c = 0;
-	while (c < ITEMTYPE_TOTAL)
+	while (c < weaptype_TOTAL)
 	{
-		Inventory_GetItemInfo(world, c);
-		if (self.iteminfo_model != "") precache_model(self.iteminfo_model);
-		if (self.iteminfo_ammo1model != "") precache_model(self.iteminfo_ammo1model);
-		if (self.iteminfo_ammo2model != "") precache_model(self.iteminfo_ammo2model);
-		if (self.iteminfo_ammo1tracermodel != "") precache_model(self.iteminfo_ammo1tracermodel);
-		if (self.iteminfo_ammo2tracermodel != "") precache_model(self.iteminfo_ammo2tracermodel);
-		if (self.iteminfo_pickupsound != "") precache_sound(self.iteminfo_pickupsound);
-		if (self.iteminfo_ammo1firesound != "") precache_sound(self.iteminfo_ammo1firesound);
-		if (self.iteminfo_ammo1explodesound != "") precache_sound(self.iteminfo_ammo1explodesound);
-		if (self.iteminfo_ammo1bouncesound != "") precache_sound(self.iteminfo_ammo1bouncesound);
-		if (self.iteminfo_ammo2firesound != "") precache_sound(self.iteminfo_ammo2firesound);
-		if (self.iteminfo_ammo2explodesound != "") precache_sound(self.iteminfo_ammo2explodesound);
-		if (self.iteminfo_ammo2bouncesound != "") precache_sound(self.iteminfo_ammo2bouncesound);
-		if (self.iteminfo_weapon_viewmodel != "") precache_model(self.iteminfo_weapon_viewmodel);
+		Inventory_Getweapinfo(world, c);
+		if (self.weapinfo_model != "") precache_model(self.weapinfo_model);
+		if (self.weapinfo_ammo1model != "") precache_model(self.weapinfo_ammo1model);
+		if (self.weapinfo_ammo2model != "") precache_model(self.weapinfo_ammo2model);
+		if (self.weapinfo_ammo1tracermodel != "") precache_model(self.weapinfo_ammo1tracermodel);
+		if (self.weapinfo_ammo2tracermodel != "") precache_model(self.weapinfo_ammo2tracermodel);
+		if (self.weapinfo_pickupsound != "") precache_sound(self.weapinfo_pickupsound);
+		if (self.weapinfo_ammo1firesound != "") precache_sound(self.weapinfo_ammo1firesound);
+		if (self.weapinfo_ammo1explodesound != "") precache_sound(self.weapinfo_ammo1explodesound);
+		if (self.weapinfo_ammo1bouncesound != "") precache_sound(self.weapinfo_ammo1bouncesound);
+		if (self.weapinfo_ammo2firesound != "") precache_sound(self.weapinfo_ammo2firesound);
+		if (self.weapinfo_ammo2explodesound != "") precache_sound(self.weapinfo_ammo2explodesound);
+		if (self.weapinfo_ammo2bouncesound != "") precache_sound(self.weapinfo_ammo2bouncesound);
+		if (self.weapinfo_weapon_viewmodel != "") precache_model(self.weapinfo_weapon_viewmodel);
 		c = c + 1;
 	}
 
@@ -535,13 +535,13 @@
 	best = -1;
 	rank = 0;
 	c = 0;
-	while (c < ITEMTYPE_TOTAL)
+	while (c < weaptype_TOTAL)
 	{
-		Inventory_GetItemInfo(character, c);
-		if (character.iteminfo_weapon_canraise)
-		if (rank < character.iteminfo_weapon_rank)
+		Inventory_Getweapinfo(character, c);
+		if (character.weapinfo_weapon_canraise)
+		if (rank < character.weapinfo_weapon_rank)
 		{
-			rank = character.iteminfo_weapon_rank;
+			rank = character.weapinfo_weapon_rank;
 			best = c;
 		}
 		c = c + 1;
@@ -556,20 +556,20 @@
 	local float c;
 	best = -1;
 	rank = 0;
-	c = ITEMTYPE_ITEM1;
-	while (c < ITEMTYPE_AMMO1)
+	c = weaptype_ITEM1;
+	while (c < weaptype_AMMO1)
 	{
-		Inventory_GetItemInfo(character, c);
-		if (character.iteminfo_weapon_canraise)
+		Inventory_Getweapinfo(character, c);
+		if (character.weapinfo_weapon_canraise)
 			best = c;
 		c = c + 1;
 	}
 	return best;
 };
 
-vector(entity character, float itemtype, float adjustquantity, float adjustammo) Inventory_ModifyItem =
+vector(entity character, float weaptype, float adjustquantity, float adjustammo) Inventory_ModifyItem =
 {
-	local float olditemtype;
+	local float oldweaptype;
 	local vector item, olditem;
 	if (character.unlimitedinventory)
 	if (adjustquantity < 0)
@@ -577,72 +577,72 @@
 	if (adjustquantity == 0)
 	if (adjustammo == 0)
 		return '0 0 0';
-	olditemtype = character.iteminfo_itemtype;
-	Inventory_GetItemInfo(character, itemtype);
-	item = Inventory_GetItem(character, itemtype);
+	oldweaptype = character.weapinfo_weaptype;
+	Inventory_Getweapinfo(character, weaptype);
+	item = Inventory_GetItem(character, weaptype);
 	olditem = item;
-	item_x = bound(0, item_x + adjustquantity, character.iteminfo_quantitymax);
-	item_y = bound(0, item_y + adjustammo, character.iteminfo_ammomax);
-	//item_z = bound(0, item_z + adjustammo2, character.iteminfo_ammo2max);
-	Inventory_SetItem(character, itemtype, item);
-	// update iteminfo for olditemtype
-	// (if olditemtype == itemtype then we want to update it because the item
-	//  has been modified, if olditemtype != itemtype then we need to restore
-	//  it to the olditemtype to avoid messing up things for the caller)
-	Inventory_GetItemInfo(character, olditemtype);
+	item_x = bound(0, item_x + adjustquantity, character.weapinfo_quantitymax);
+	item_y = bound(0, item_y + adjustammo, character.weapinfo_ammomax);
+	//item_z = bound(0, item_z + adjustammo2, character.weapinfo_ammo2max);
+	Inventory_SetItem(character, weaptype, item);
+	// update weapinfo for oldweaptype
+	// (if oldweaptype == weaptype then we want to update it because the item
+	//  has been modified, if oldweaptype != weaptype then we need to restore
+	//  it to the oldweaptype to avoid messing up things for the caller)
+	Inventory_Getweapinfo(character, oldweaptype);
 	return item - olditem;
 };
 
 void(entity to, entity from) Inventory_CloneFromInventory =
 {
-	local float itemtype;
-	itemtype = 0;
-	while (itemtype < ITEMTYPE_TOTAL)
+	local float weaptype;
+	weaptype = 0;
+	while (weaptype < weaptype_TOTAL)
 	{
-		Inventory_SetItem(to, itemtype, Inventory_GetItem(from, itemtype));
-		itemtype = itemtype + 1;
+		Inventory_SetItem(to, weaptype, Inventory_GetItem(from, weaptype));
+		weaptype = weaptype + 1;
 	}
 };
 
 void(entity to, entity from) Inventory_AddFromInventory =
 {
-	local float itemtype;
+	local float weaptype;
 	local vector item;
-	itemtype = 0;
-	while (itemtype < ITEMTYPE_TOTAL)
+	weaptype = 0;
+	while (weaptype < weaptype_TOTAL)
 	{
-		item = Inventory_GetItem(from, itemtype);
+		item = Inventory_GetItem(from, weaptype);
 		if (item != '0 0 0')
-			Inventory_ModifyItem(to, itemtype, item_x, item_y);
-		itemtype = itemtype + 1;
+			Inventory_ModifyItem(to, weaptype, item_x, item_y);
+		weaptype = weaptype + 1;
 	}
 };
 
 /*
-float ITEMTYPE_TOTAL3 = 60;
-.float inventory[ITEMTYPE_TOTAL3];
-vector(entity character, float itemtype) Inventory_GetItem =
+float weaptype_TOTAL3 = 60;
+.float inventory[weaptype_TOTAL3];
+vector(entity character, float weaptype) Inventory_GetItem =
 {
 	local vector v;
-	itemtype = itemtype * 3;
-	v_x = character.inventory[itemtype];
-	v_y = character.inventory[itemtype+1];
-	v_z = character.inventory[itemtype+2];
+	weaptype = weaptype * 3;
+	v_x = character.inventory[weaptype];
+	v_y = character.inventory[weaptype+1];
+	v_z = character.inventory[weaptype+2];
 	return v;
 };
-void(entity character, float itemtype, vector item) Inventory_SetItem =
+void(entity character, float weaptype, vector item) Inventory_SetItem =
 {
-	itemtype = itemtype * 3;
-	character.inventory[itemtype] = item_x;
-	character.inventory[itemtype+1] = item_y;
-	character.inventory[itemtype+2] = item_z;
+	weaptype = weaptype * 3;
+	character.inventory[weaptype] = item_x;
+	character.inventory[weaptype+1] = item_y;
+	character.inventory[weaptype+2] = item_z;
 };
 */
 
 void(entity character) Inventory_Clear =
 {
 	local float c;
-	for (c = 0;c < ITEMTYPE_TOTAL;c++)
+	for (c = 0;c < weaptype_TOTAL;c++)
 		Inventory_SetItem(self, c, '0 0 0');
 };
 
@@ -688,7 +688,7 @@
 		sound(self, CHAN_BODY, "misc/health_medium.wav", 1, ATTN_NORM);
 	else if (self.health > 0)
 		sound(self, CHAN_BODY, "misc/health_small.wav", 1, ATTN_NORM);
-	else if ((self.itemitemtype < ITEMTYPE_AI_WEAP1) && (self.itemitemtype != 0))
+	else if ((self.itemweaptype < weaptype_AI_WEAP1) && (self.itemweaptype != 0))
 		sound(self, CHAN_BODY, "misc/weaponpickup.ogg", 1, ATTN_NORM);
 	else
 		sound(self, CHAN_BODY, "misc/itempickup.ogg", 1, ATTN_NORM);
@@ -708,8 +708,8 @@
 	else
 	{
 		Inventory_AddFromInventory(other, self);
-		if (self.itemitemtype < ITEMTYPE_AI_WEAP1)
-		   other.switchweaponitem = self.itemitemtype;
+		if (self.itemweaptype < weaptype_AI_WEAP1)
+		   other.switchweaponitem = self.itemweaptype;
 	}
 	
 	if (self.respawntime > 0)
@@ -727,15 +727,15 @@
 };
 
 .float ispointable;
-void(float itemtype, float quantity, float ammo1, vector org, vector vel, float respawntim, float modelscale, entity own) Item_Spawn =
+void(float weaptype, float quantity, float ammo1, vector org, vector vel, float respawntim, float modelscale, entity own) Item_Spawn =
 {
-	Inventory_GetItemInfo(world, itemtype);
+	Inventory_Getweapinfo(world, weaptype);
 	newmis = spawn();
 	newmis.owner = own;
 	newmis.respawntime = respawntim;
 	newmis.classname = "item";
-	newmis.netname = strzone(world.iteminfo_name);
-	newmis.itemitemtype = itemtype;
+	newmis.netname = strzone(world.weapinfo_name);
+	newmis.itemweaptype = weaptype;
 	newmis.ispointable = TRUE;
 	newmis.solid = SOLID_TRIGGER;
 	newmis.movetype = MOVETYPE_BOUNCE;
@@ -751,12 +751,12 @@
 	
 	if (cvar("g_itemtouchpickup"))
 		newmis.touch = Item_Pickup;
-	//newmis.noise = strzone(character.iteminfo_pickupsound);
+	//newmis.noise = strzone(character.weapinfo_pickupsound);
 	setorigin(newmis, org);
-	setmodel(newmis, world.iteminfo_pickupmodel);
+	setmodel(newmis, world.weapinfo_pickupmodel);
 	setsize(newmis, '-25 -25 -25', '8 8 8');
-	Inventory_ModifyItem(newmis, itemtype, quantity, ammo1);
-	newmis.colormod = world.iteminfo_modelcolormod;
+	Inventory_ModifyItem(newmis, weaptype, quantity, ammo1);
+	newmis.colormod = world.weapinfo_modelcolormod;
 	
 	//newmis.effects = newmis.effects | EF_FULLBRIGHT;
 	newmis.scale = modelscale;
@@ -764,70 +764,70 @@
 
 void() weapon_thenex =
 {
- 	Item_Spawn(ITEMTYPE_WEAP10,1,50,self.origin,'0 0 0',10,1.5,world);
+ 	Item_Spawn(weaptype_WEAP10,1,50,self.origin,'0 0 0',10,1.5,world);
 }
 
 
 void() weapon_weap1 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP1,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP1,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap2 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP2,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP2,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap3 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP3,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP3,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap4 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP4,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP4,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap5 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP5,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP5,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap6 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP6,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP6,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap7 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP7,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP7,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap8 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP8,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP8,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 void() weapon_weap9 =
 {
- 	Item_Spawn(ITEMTYPE_WEAP9,1,100,self.origin,'0 0 0',0,1.5,world);
+ 	Item_Spawn(weaptype_WEAP9,1,100,self.origin,'0 0 0',0,1.5,world);
 }
 
 //void() item_ammo1 =
 //{
-// 	Item_Spawn(ITEMTYPE_AMMO1,50,0,self.origin,'0 0 0',0,1,world);
+// 	Item_Spawn(weaptype_AMMO1,50,0,self.origin,'0 0 0',0,1,world);
 //}
 void() item_ammo2 =
 {
- 	Item_Spawn(ITEMTYPE_AMMO2,50,0,self.origin,'0 0 0',0,1,world);
+ 	Item_Spawn(weaptype_AMMO2,50,0,self.origin,'0 0 0',0,1,world);
 }
 void() item_ammo3 =
 {
- 	Item_Spawn(ITEMTYPE_AMMO3,50,0,self.origin,'0 0 0',0,1,world);
+ 	Item_Spawn(weaptype_AMMO3,50,0,self.origin,'0 0 0',0,1,world);
 }
 void() item_ammo4 =
 {
- 	Item_Spawn(ITEMTYPE_AMMO4,50,0,self.origin,'0 0 0',0,1,world);
+ 	Item_Spawn(weaptype_AMMO4,50,0,self.origin,'0 0 0',0,1,world);
 }
 
 void() armor_small =
@@ -965,16 +965,16 @@
 	character.inventory_weap6_clip = 0;
 };
 
-float ITEMTYPE_EMPTY = 0;
-float ITEMTYPE_TOTAL = 6;
+float weaptype_EMPTY = 0;
+float weaptype_TOTAL = 6;
 
-float ITEMTYPERANGE_WEAPONS = '0 3 0';
-float ITEMTYPERANGE_BACKPACK = '3 16 0';
-float ITEMTYPERANGE_ALL = '0 32 0';
-float ITEMTYPERANGE = 32;
+float weaptypeRANGE_WEAPONS = '0 3 0';
+float weaptypeRANGE_BACKPACK = '3 16 0';
+float weaptypeRANGE_ALL = '0 32 0';
+float weaptypeRANGE = 32;
 
-// _x is an ITEMTYPE_ value, _y is another ITEMTYPE_ value for ammo type, _z is current ammo
-.vector inventory[ITEMTYPERANGE];
+// _x is an weaptype_ value, _y is another weaptype_ value for ammo type, _z is current ammo
+.vector inventory[weaptypeRANGE];
 
 void(entity character, vector inventoryrange) Inventory_Clear =
 {
@@ -988,7 +988,7 @@
 };
 
 // returns TRUE if item fit
-float(entity character, vector inventoryrange, float itemtype, float ammotype, float ammo) Inventory_AddItem =
+float(entity character, vector inventoryrange, float weaptype, float ammotype, float ammo) Inventory_AddItem =
 {
 	local float c;
 	c = inventoryrange_x;
@@ -996,7 +996,7 @@
 	{
 		if (!character.inventory[c]_x)
 		{
-			character.inventory[c]_x = itemtype;
+			character.inventory[c]_x = weaptype;
 			character.inventory[c]_y = ammotype;
 			character.inventory[c]_z = ammo;
 			return TRUE;

Modified: trunk/progsqc/player.qc
===================================================================
--- trunk/progsqc/player.qc	2008-10-20 15:05:46 UTC (rev 130)
+++ trunk/progsqc/player.qc	2008-12-12 23:17:02 UTC (rev 131)
@@ -175,33 +175,33 @@
 		 
 		 Inventory_Clear(pc);
 		 
-		 for (i=1; i < ITEMTYPE_AI_WEAP1; i++)
+		 for (i=1; i < weaptype_ITEM1 - weaptype_AI_WEAP1; i++)
 		 {
-		  	 if (cvar(cname,"_weapon",ftos(i)) != 0)
+		  	 if (cvar(cname,"_aiweapon",ftos(i)) != 0)
 		 	 {
-		  		newweapon = cvar(cname,"_weapon",ftos(i)) - 1;
-		  		Inventory_GetItemInfo(pc, newweapon);
-		  		Inventory_ModifyItem(pc, newweapon, 1, pc.iteminfo_ammomax);
+		  		newweapon = cvar(cname,"_aiweapon",ftos(i)) - 1 + weaptype_AI_WEAP1;
+		  		Inventory_Getweapinfo(pc, newweapon);
+		  		Inventory_ModifyItem(pc, newweapon, 1, pc.weapinfo_ammomax);
 		 	 }
 		 }
 		 
-		 for (i=1; i <= (ITEMTYPE_AMMO1 - ITEMTYPE_ITEM1); i++)
+		 for (i=1; i <= (weaptype_AMMO1 - weaptype_ITEM1); i++)
 		 {
 		  	 if (cvar(cname,"_item",ftos(i)) != 0)
 		 	 {
 		  		newweapon = cvar(cname,"_item",ftos(i)) - 1;
-		  		Inventory_GetItemInfo(pc, newweapon + ITEMTYPE_ITEM1);
-		  		Inventory_ModifyItem(pc, newweapon + ITEMTYPE_ITEM1, pc.iteminfo_quantitymax, 0);
+		  		Inventory_Getweapinfo(pc, newweapon + weaptype_ITEM1);
+		  		Inventory_ModifyItem(pc, newweapon + weaptype_ITEM1, pc.weapinfo_quantitymax, 0);
 		 	 }
 		 }
 		 
-		 for (i=1; i < ITEMTYPE_ITEM1 - ITEMTYPE_AI_WEAP1; i++)
+		 for (i=1; i < weaptype_AI_WEAP1; i++)
 		 {
-		  	 if (cvar(cname,"_aiweapon",ftos(i)) != 0)
+		  	 if (cvar(cname,"_weapon",ftos(i)) != 0)
 		 	 {
-		  		newweapon = cvar(cname,"_aiweapon",ftos(i)) - 1 + ITEMTYPE_AI_WEAP1;
-		  		Inventory_GetItemInfo(pc, newweapon);
-		  		Inventory_ModifyItem(pc, newweapon, 1, pc.iteminfo_ammomax);
+		  		newweapon = cvar(cname,"_weapon",ftos(i)) - 1;
+		  		Inventory_Getweapinfo(pc, newweapon);
+		  		Inventory_ModifyItem(pc, newweapon, 1, pc.weapinfo_ammomax);
 		 	 }
 		 }
 	}
@@ -290,7 +290,7 @@
 	player_selectlegsanim(TRUE);
 	anim_start(self.actorpart_torso, self.playerclass.actoranim_TORSO_STAND, ANIMTYPE_IDLE, torso_animframefunc);
 	
-	//self.itemselected = Inventory_GetBestItem(self);
+	self.itemselected = Inventory_GetBestItem(self);
 	weapon_setup(self, Inventory_GetBestWeapon(self));
 };
 
@@ -521,49 +521,48 @@
 	   self.viewmodelchange_y = self.viewmodelchange_y - (self.movement_y / 1000);
 	   self.viewmodelchange_z = self.viewmodelchange_z - (self.velocity_z / 2000);
 	
-	   //Inventory_GetItemInfo(self, self.weaponitem);
-	   self.viewmodeldiff = self.iteminfo_viewmodeloffset - self.viewmodelchange;
+	   self.viewmodeldiff = self.weapinfo_viewmodeloffset - self.viewmodelchange;
 	   self.viewmodelchange = self.viewmodelchange + self.viewmodeldiff * 0.1;
 	   actor_setviewmodeloffset(self.viewmodelchange);
 	}
 
 	if (self.flags & FL_CLIENT)
 	{
-		//Inventory_GetItemInfo(self, self.itemselected);
-		//Inventory_ModifyItem(self, self.itemselected, 0 + self.iteminfo_rechargerate, 0);
-		//Inventory_GetItemInfo(self, self.weaponitem);
-		Inventory_ModifyItem(self, self.weaponitem, 0, 0 + self.iteminfo_rechargerate);
+		Inventory_Getweapinfo(self, self.itemselected);
+		Inventory_ModifyItem(self, self.itemselected, 0 + self.weapinfo_rechargerate, 0);
+		Inventory_Getweapinfo(self, self.weaponitem);
+		Inventory_ModifyItem(self, self.weaponitem, 0, 0 + self.weapinfo_rechargerate);
 	}
 
-	/*
 	if (self.button7)
 	{
-	 	Inventory_GetItemInfo(self, self.itemselected);
-		if ((!self.iteminfo_ammo1noprojectile) && self.weapon_canfire1 && self.weapon_canfire2 && (!self.weapon_oldbutton7 || !(self.iteminfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
+	 	Inventory_Getweapinfo(self, self.itemselected);
+		if ((!self.weapinfo_ammo1noprojectile) && self.weapon_canfire1 && self.weapon_canfire2 && (!self.weapon_oldbutton7 || !(self.weapinfo_ammo1fireflags & FIREFLAG_SEMIAUTOMATIC)))
 		{
 		   	weapon_state(WS_FIRE3);
 		}
-		else if (self.iteminfo_ammo1fireflags & FIREFLAG_JETPACK)
+		else if (self.weapinfo_ammo1fireflags & FIREFLAG_JETPACK)
 		{
-		    Inventory_ModifyItem(self, self.itemselected, 0 - self.iteminfo_ammo1minimumtofire, 0);
-			self.jetpack_fuel = self.iteminfo_quantity;
+		    Inventory_ModifyItem(self, self.itemselected, 0 - self.weapinfo_ammo1minimumtofire, 0);
+			self.jetpack_fuel = self.weapinfo_quantity;
 		   	if (!self.jetpackactive && self.jetpack_fuel > 10)
 			{
 				sound(self, CHAN_BODY, "jetpack/low.wav", 0.2, ATTN_NORM);
 				self.jetpackactive = TRUE;
 			}
 		}
-		else if (self.iteminfo_ammo1fireflags & FIREFLAG_SHIELD)
+		else if (self.weapinfo_ammo1fireflags & FIREFLAG_SHIELD)
 		{
-		    Inventory_ModifyItem(self, self.itemselected, 0 - self.iteminfo_ammo1minimumtofire, 0);
+		    Inventory_ModifyItem(self, self.itemselected, 0 - self.weapinfo_ammo1minimumtofire, 0);
 			self.shieldactive = TRUE;
 		}
-		else if (self.iteminfo_ammo1fireflags & FIREFLAG_INVIS)
+		else if (self.weapinfo_ammo1fireflags & FIREFLAG_INVIS)
 		{
-		    Inventory_ModifyItem(self, self.itemselected, 0 - self.iteminfo_ammo1minimumtofire, 0);
+		    Inventory_ModifyItem(self, self.itemselected, 0 - self.weapinfo_ammo1minimumtofire, 0);
 			self.invisactive = TRUE;
 		}
-	} */
+		Inventory_Getweapinfo(self, self.weaponitem);
+	}
 	
 	if (self.flags & FL_CLIENT) // only real players can respawn, not NPCs
 	if (self.deadflag)
@@ -611,8 +610,8 @@
 	{
 	   	if (self.button4)
 		{
-		    //Inventory_GetItemInfo(self, self.weaponitem);
-		   	if (self.iteminfo_ammo1fireflags & FIREFLAG_ZOOM)
+		    //Inventory_Getweapinfo(self, self.weaponitem);
+		   	if (self.weapinfo_ammo1fireflags & FIREFLAG_ZOOM)
 		       self.viewzoom = 0.2;
 		}
 		else
@@ -1313,31 +1312,31 @@
 		{
 			c = 0;
 			vector item;
-			while (c < ITEMTYPE_TOTAL)
+			while (c < weaptype_TOTAL)
 			{
-			 	if (c == ITEMTYPE_WEAP1)
+			 	if (c == weaptype_WEAP1)
 				   bprint("User Weapons:    AT=Ammotype   Q=Quantity   A=Ammo","\n");
-			 	if (c == ITEMTYPE_AI_WEAP1)
+			 	if (c == weaptype_AI_WEAP1)
 				   bprint("AI Weapons:","\n");
-			 	if (c == ITEMTYPE_ITEM1)
+			 	if (c == weaptype_ITEM1)
 				   bprint("Items:","\n");
-			 	if (c == ITEMTYPE_AMMO1)
+			 	if (c == weaptype_AMMO1)
 				   bprint("Ammo:","\n");
 				   
-				Inventory_GetItemInfo(self, c);
+				Inventory_Getweapinfo(self, c);
 				item = Inventory_GetItem(self, c);
-				bprint(ftos(c),".  AT:", ftos(self.iteminfo_ammotype)," Q:",ftos(item_x)," A:",ftos(item_y));
-				bprint("  ", self.iteminfo_name,"\n");
+				bprint(ftos(c),".  AT:", ftos(self.weapinfo_ammotype)," Q:",ftos(item_x)," A:",ftos(item_y));
+				bprint("  ", self.weapinfo_name,"\n");
 				c = c + 1;
 			}
 		}
 		if (impuls == 20)
 		{
 			c = 0;
-			while (c < ITEMTYPE_AI_WEAP1)
+			while (c < weaptype_AI_WEAP1)
 			{
-				Inventory_GetItemInfo(self, c);
-				Inventory_ModifyItem(self, c, self.iteminfo_quantitymax, self.iteminfo_ammomax);
+				Inventory_Getweapinfo(self, c);
+				Inventory_ModifyItem(self, c, self.weapinfo_quantitymax, self.weapinfo_ammomax);
 				c = c + 1;
 			}
 			self.switchweaponitem = Inventory_GetBestWeapon(self);
@@ -1349,17 +1348,17 @@
 		w = 0;
 		while (select >= 0)
 		{
-			if (w >= ITEMTYPE_AI_WEAP1)
+			if (w >= weaptype_AI_WEAP1)
 				break;
-			Inventory_GetItemInfo(self, w);
-			if (self.iteminfo_weapon_canraise)
+			Inventory_Getweapinfo(self, w);
+			if (self.weapinfo_weapon_canraise)
 			{
 				select = select - 1;
 				if (select == 0)
 				{
 					self.switchweaponitem = w;
 					sound(self, CHAN_BODY, "misc/weapon_switch.ogg", 1, ATTN_NORM);
-					//bprint(character.iteminfo_name,"\n");
+					//bprint(character.weapinfo_name,"\n");
 					break;
 				}
 			}
@@ -1372,16 +1371,16 @@
 		while (TRUE)
 		{
 			w = w + 1;
-			if (w >= ITEMTYPE_ITEM1)
+			if (w >= weaptype_ITEM1)
 				w = 0;
 			if (w == self.switchweaponitem)
 				break;
-			Inventory_GetItemInfo(self, w);
-			if (self.iteminfo_weapon_canraise)
+			Inventory_Getweapinfo(self, w);
+			if (self.weapinfo_weapon_canraise)
 			{
 				self.switchweaponitem = w;
 				sound(self, CHAN_BODY, "misc/weapon_switch.ogg", 1, ATTN_NORM);
-				//bprint(character.iteminfo_name,"\n");
+				//bprint(character.weapinfo_name,"\n");
 				break;
 			}
 		}
@@ -1393,15 +1392,15 @@
 		{
 			w = w - 1;
 			if (w < 0)
-				w = ITEMTYPE_ITEM1 - 1;
+				w = weaptype_ITEM1 - 1;
 			if (w == self.switchweaponitem)
 				break;
-			Inventory_GetItemInfo(self, w);
-			if (self.iteminfo_weapon_canraise)
+			Inventory_Getweapinfo(self, w);
+			if (self.weapinfo_weapon_canraise)
 			{
 				self.switchweaponitem = w;
 				sound(self, CHAN_BODY, "misc/weapon_switch.ogg", 1, ATTN_NORM);
-				//bprint(character.iteminfo_name,"\n");
+				//bprint(character.weapinfo_name,"\n");
 				break;
 			}
 		}
@@ -1413,14 +1412,14 @@
 		while (TRUE)
 		{
 			w = w + 1;
-			if (w >= ITEMTYPE_AMMO1)
-				w = ITEMTYPE_ITEM1;
+			if (w >= weaptype_AMMO1)
+				w = weaptype_ITEM1;
 			if (w == self.itemselected)
 				break;
-			Inventory_GetItemInfo(self, w);
-			if (self.iteminfo_weapon_canraise)
+			Inventory_Getweapinfo(self, w);
+			if (self.weapinfo_weapon_canraise)
 			{
-			   	//bprint(character.iteminfo_name,"\n");
+			   	//bprint(character.weapinfo_name,"\n");
 				self.itemselected = w;
 				break;
 			}




More information about the zymotic-commits mailing list