From: Jakob MG Date: Thu, 29 Dec 2011 11:09:02 +0000 (+0100) Subject: Nexball ball position in Basketball mode (issue 783). Still needs to be better (csqc... X-Git-Tag: xonotic-v0.6.0~40^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5de1a4f691c694f0c83866bee4243d7c3a9bdbe8;p=xonotic%2Fxonotic-data.pk3dir.git Nexball ball position in Basketball mode (issue 783). Still needs to be better (csqc likely) but good enougth for now --- diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 5463476648..4f88929144 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -101,8 +101,8 @@ void GiveBall(entity plyr, entity ball) WaypointSprite_Kill(ball.waypointsprite_attachedforcarrier); } - setattachment(ball, plyr, ""); - setorigin(ball, BALL_ATTACHORG); + //setattachment(ball, plyr, ""); + setorigin(ball, plyr.origin + plyr.view_ofs); if(ball.team != plyr.team) ball.teamtime = time + autocvar_g_nexball_basketball_delay_hold_forteam; @@ -517,7 +517,7 @@ void spawnfunc_nexball_basketball(void) CVTOV(g_nexball_basketball_delay_hold_forteam); CVTOV(g_nexball_basketball_teamsteal); */ - autocvar_g_nexball_basketball_effects_default = autocvar_g_nexball_basketball_effects_default & BALL_EFFECTMASK; + autocvar_g_nexball_basketball_effects_default = autocvar_g_nexball_basketball_effects_default & BALL_EFFECTMASK; } if(!self.effects) self.effects = autocvar_g_nexball_basketball_effects_default; @@ -720,10 +720,34 @@ void W_Nexball_Attack2(void) missile.flags = FL_PROJECTILE; } +var const float() nullfunc; +float ball_customize() +{ + if(!self.owner) + self.customizeentityforclient = nullfunc; + + if(other == self.owner) + self.scale = 0.5; + else + self.scale = 1; + return TRUE; +} + float w_nexball_weapon(float req) { if(req == WR_THINK) { + + + if(nexball_mode & NBM_BASKETBALL) + if(!self.BUTTON_ATCK && self.ballcarried) + { + makevectors(self.v_angle); + self.ballcarried.velocity = self.velocity; + self.ballcarried.customizeentityforclient = ball_customize; + setorigin(self.ballcarried, self.origin + self.view_ofs + v_forward * 23 + v_right * 4); + } + if(self.BUTTON_ATCK) if(weapon_prepareattack(0, autocvar_g_balance_nexball_primary_refire)) if(autocvar_g_nexball_basketball_meter) @@ -796,6 +820,7 @@ MUTATOR_HOOKFUNCTION(nexball_BuildMutatorsPrettyString) return 0; } + MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn) { if(nexball_mode & NBM_BASKETBALL)