Skip to content

Commit

Permalink
Disallow grapple hook when attacking or dueling
Browse files Browse the repository at this point in the history
  • Loading branch information
Razish committed Dec 25, 2013
1 parent 74d164d commit 342a3b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions game/g_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -3437,6 +3437,8 @@ void ClientThink_real( gentity_t *ent ) {
if ( ent->s.eType != ET_NPC &&
ent->client &&
ent->client->pers.connected == CON_CONNECTED &&
!ent->client->ps.duelInProgress &&
!BG_SaberInAttack( ent->client->ps.saberMove ) &&
!!(japp_allowHook.integer & (1<<level.gametype)))
{
if ( !ent->client->hook && (pm.cmd.buttons & BUTTON_GRAPPLE) && ent->client->ps.pm_type != PM_DEAD /*&& !ent->client->hookHasBeenFired*/ )
Expand Down
16 changes: 11 additions & 5 deletions game/g_missile.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,16 @@ void G_RunMissile( gentity_t *ent ) {
}
}

if ( ent->parent &&
ent->parent->client &&
ent->parent->client->hook == ent &&
(ent->parent->client->ps.duelInProgress ||
BG_SaberInAttack( ent->parent->client->ps.saberMove ) ||
!(japp_allowHook.integer & (1<<level.gametype))) )
{// not allowed to have hook out
Weapon_HookFree( ent->parent->client->hook );
}

if ( tr.fraction != 1) {
// never explode or bounce on sky
if ( tr.surfaceFlags & SURF_NOIMPACT )
Expand All @@ -958,11 +968,7 @@ void G_RunMissile( gentity_t *ent ) {
// if ( ent->parent && ent->parent->client && ent->parent->client->hook == ent )
// ent->parent->client->hook = NULL;
if ( ent->parent && ent->parent->client && ent->parent->client->hook == ent )
{
ent->parent->client->hook = NULL;
ent->parent->client->hookHasBeenFired = qfalse;
ent->parent->client->fireHeld = qfalse;
}
Weapon_HookFree( ent->parent->client->hook );
//[/Grapple]

if ((ent->s.weapon == WP_SABER && ent->isSaberEntity) || isKnockedSaber)
Expand Down

0 comments on commit 342a3b8

Please sign in to comment.