X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fporto.qc;h=e2ac5ee796b3d51a1520fd9170a1369effe08bb9;hb=2f215c603bf1b4dd44b9d166180f535c88602e9f;hp=b998bc9ee8d41d42c7ee51b976cbe6cc4e63f7d3;hpb=c5fcf672c473edef7139d4250398184b8ae17224;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index b998bc9ee..e2ac5ee79 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -66,7 +66,7 @@ void W_Porto_Success(entity this) delete(this); } -string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo); +string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo, .entity weaponentity); void W_Porto_Fail(entity this, float failhard) { if(this.realowner == NULL) @@ -95,7 +95,8 @@ void W_Porto_Fail(entity this, float failhard) tracetoss(this, this); if(vdist(trace_endpos - this.realowner.origin, <, 128)) { - W_ThrowNewWeapon(this.realowner, WEP_PORTO.m_id, 0, this.origin, this.velocity); + .entity weaponentity = this.weaponentity_fld; + W_ThrowNewWeapon(this.realowner, WEP_PORTO.m_id, 0, this.origin, this.velocity, weaponentity); Send_Notification(NOTIF_ONE, this.realowner, MSG_CENTER, CENTER_PORTO_FAILED); } } @@ -148,9 +149,9 @@ void W_Porto_Touch(entity this, entity toucher) sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); delete(this); } - else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP) + else if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK) || (trace_dphitcontents & DPCONTENTS_PLAYERCLIP)) { - spamsound(this, CH_SHOTS, SND(PORTO_BOUNCE), VOL_BASE, ATTEN_NORM); + spamsound(this, CH_SHOTS, SND_PORTO_BOUNCE, VOL_BASE, ATTEN_NORM); // just reflect this.right_vector = this.right_vector - 2 * trace_plane_normal * (this.right_vector * trace_plane_normal); this.angles = vectoangles(this.velocity - 2 * trace_plane_normal * (this.velocity * trace_plane_normal)); @@ -255,6 +256,7 @@ void W_Porto_Attack(entity actor, .entity weaponentity, float type) //Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); gren = new(porto); + gren.weaponentity_fld = weaponentity; gren.cnt = type; gren.owner = gren.realowner = actor; gren.playerid = actor.playerid; @@ -297,12 +299,12 @@ void W_Porto_Attack(entity actor, .entity weaponentity, float type) MUTATOR_CALLHOOK(EditProjectile, actor, gren); } -METHOD(PortoLaunch, wr_aim, void(entity thiswep, entity actor)) +METHOD(PortoLaunch, wr_aim, void(entity thiswep, entity actor, .entity weaponentity)) { PHYS_INPUT_BUTTON_ATCK(actor) = false; PHYS_INPUT_BUTTON_ATCK2(actor) = false; if(!WEP_CVAR(porto, secondary)) - if(bot_aim(actor, WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false)) + if(bot_aim(actor, weaponentity, WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false)) PHYS_INPUT_BUTTON_ATCK(actor) = true; } METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) @@ -329,27 +331,21 @@ METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weapone } else { - if(actor.porto_v_angle_held) + if(actor.(weaponentity).porto_v_angle_held) { if(!(fire & 2)) - { - actor.porto_v_angle_held = 0; - - ClientData_Touch(actor); - } + actor.(weaponentity).porto_v_angle_held = 0; } else { if(fire & 2) { - actor.porto_v_angle = actor.v_angle; - actor.porto_v_angle_held = 1; - - ClientData_Touch(actor); + actor.(weaponentity).porto_v_angle = actor.v_angle; + actor.(weaponentity).porto_v_angle_held = 1; } } - if(actor.porto_v_angle_held) - makevectors(actor.porto_v_angle); // override the previously set angles + if(actor.(weaponentity).porto_v_angle_held) + makevectors(actor.(weaponentity).porto_v_angle); // override the previously set angles if(fire & 1) if(!actor.porto_current) @@ -361,20 +357,16 @@ METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weapone } } } -METHOD(PortoLaunch, wr_checkammo1, bool(entity thiswep, entity this)) +METHOD(PortoLaunch, wr_checkammo1, bool(entity thiswep, entity this, .entity weaponentity)) { // always allow infinite ammo return true; } -METHOD(PortoLaunch, wr_checkammo2, bool(entity thiswep, entity this)) +METHOD(PortoLaunch, wr_checkammo2, bool(entity thiswep, entity this, .entity weaponentity)) { // always allow infinite ammo return true; } -METHOD(PortoLaunch, wr_setup, void(entity thiswep, entity actor)) -{ - actor.ammo_field = ammo_none; -} METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep, entity actor)) { actor.porto_current = NULL;