r61 - trunk/basezym/progsqc
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Sep 30 22:53:48 EDT 2006
Author: havoc
Date: 2006-09-30 22:53:48 -0400 (Sat, 30 Sep 2006)
New Revision: 61
Modified:
trunk/basezym/progsqc/actor.qc
Log:
fixed positioning of first person weapon model
fixed weapon switching code to show the correct weapon model
Modified: trunk/basezym/progsqc/actor.qc
===================================================================
--- trunk/basezym/progsqc/actor.qc 2006-10-01 02:51:04 UTC (rev 60)
+++ trunk/basezym/progsqc/actor.qc 2006-10-01 02:53:48 UTC (rev 61)
@@ -70,6 +70,7 @@
.entity playerclass;
void() actor_setup =
{
+ local vector v;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
@@ -108,6 +109,10 @@
setmodel(self.actorpart_head, strcat(self.playerclass.modeldir, "/head", self.playerclass.modelext));
self.actorpart_weapon.model = ""; // will be changed by weapon code as needed
self.actorpart_viewweapon.model = ""; // will be changed by weapon code as needed
+ // FIXME: add a hands viewmodel for each player model (animated to match the torso) and attach the weapon to it, until this is done this setorigin is necessary to put it in roughly the right place on the screen
+ v = self.weapon_ofs - self.view_ofs + '4 0 0';
+ v_y = v_y * -1;
+ setorigin(self.actorpart_viewweapon, v);
// it's ok if this bone is missing as long as the torso model is made
// relative to the legs origin, but that prevents any chance of leaning
@@ -119,7 +124,7 @@
setattachment(self.actorpart_weapon, self.actorpart_torso, "tag_weapon");
if (!self.actorpart_weapon.tag_index)
setattachment(self.actorpart_weapon, self.actorpart_torso, "bip01 r hand");
- // model seen in first person while hodling weapon
+ // model seen in first person while holding weapon
self.actorpart_viewweapon.viewmodelforclient = self;
};
@@ -206,10 +211,11 @@
{
if (self.weaponstate == WS_LOWER)
{
- if (time > self.lowerguntime)
+ if (time >= self.lowerguntime)
{
//bprint("raising\n");
self.weaponitem = self.switchweaponitem;
+ Inventory_GetItemInfo(self, self.weaponitem);
actor_setweaponmodel(iteminfo_model, iteminfo_weapon_viewmodel);
weapon_state(WS_RAISE);
}
More information about the zymotic-commits
mailing list