Skip to content

Commit

Permalink
saberthrow drop fix
Browse files Browse the repository at this point in the history
  • Loading branch information
videoP committed Apr 27, 2024
1 parent 997af4f commit 8225edd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
2 changes: 2 additions & 0 deletions codemp/game/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2324,6 +2324,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
G_BreakArm(self, 0); //unbreak anything we have broken
self->client->ps.saberEntityNum = self->client->saberStoredIndex; //in case we died while our saber was knocked away.

/* same frame kill fix bucky
if (self->client->ps.weapon == WP_SABER && self->client->saberKnockedTime)
{
gentity_t *saberEnt = &g_entities[self->client->ps.saberEntityNum];
Expand All @@ -2335,6 +2336,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
saberEnt->nextthink = level.time;
G_RunObject(saberEnt);
}
*/

self->client->bodyGrabIndex = ENTITYNUM_NONE;
self->client->bodyGrabTime = 0;
Expand Down
30 changes: 17 additions & 13 deletions codemp/game/g_missile.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,28 +447,32 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
qboolean isKnockedSaber = qfalse;

other = &g_entities[trace->entityNum];

// check for bounce
if ( other->takedamage &&
if ( !other->takedamage &&
(ent->bounceCount > 0 || ent->bounceCount == -5) &&
( ent->flags & ( FL_BOUNCE | FL_BOUNCE_HALF ) ) &&
((g_tweakWeapons.integer & WT_TRIBES) && ent->s.weapon == WP_REPEATER && ent->setTime && ent->setTime > level.time - 300))
(
((g_tweakWeapons.integer & WT_TRIBES) && ent->s.weapon == WP_REPEATER && ent->setTime && level.time - ent->setTime < 1000) ||
((g_tweakWeapons.integer & WT_TRIBES) && ent->s.weapon == WP_FLECHETTE && ent->setTime && level.time - ent->setTime < 1000)
)
)
{ //if its a direct hit and first 500ms of mortar, bounce off player.
G_BounceMissile( ent, trace );
G_AddEvent( ent, EV_GRENADE_BOUNCE, 0 );
ent->nextthink = level.time + 1500;
if (ent->nextthink && ent->nextthink - level.time > 1500) //don't increase its timer on a bounce
ent->nextthink = level.time + 1500;
return;
}
else if ( !other->takedamage &&
else if (!other->takedamage &&
(ent->bounceCount > 0 || ent->bounceCount == -5) &&
( ent->flags & ( FL_BOUNCE | FL_BOUNCE_HALF ) ) ) { //only on the first bounce vv
if ((!(g_tweakWeapons.integer & WT_TRIBES && ent->s.weapon == WP_REPEATER && ent->bounceCount == 50 && ent->setTime && ent->setTime < level.time - 1000)) &&
!(g_tweakWeapons.integer & WT_TRIBES && ent->s.weapon == WP_FLECHETTE && ent->bounceCount == 50 && ent->setTime && ent->setTime < level.time - 500))
//give this mortar a 1 second 'fuse' until its armed
{
G_BounceMissile( ent, trace );
G_AddEvent( ent, EV_GRENADE_BOUNCE, 0 );
ent->nextthink = level.time + 1500;
(ent->flags & (FL_BOUNCE | FL_BOUNCE_HALF))) {

if ((g_tweakWeapons.integer & WT_TRIBES) && ent->s.weapon == WP_REPEATER || ent->s.weapon == WP_FLECHETTE) {
}
else {

G_BounceMissile(ent, trace);
G_AddEvent(ent, EV_GRENADE_BOUNCE, 0);
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion codemp/game/g_weapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -3180,7 +3180,7 @@ static void WP_CreateMortar( vec3_t start, vec3_t fwd, gentity_t *self)
missile->takedamage = qtrue;
missile->r.contents = MASK_SHOT; //solid?
missile->die = RocketDie;
//===testing being able to shoot rockets out of the air==================================
//===testing being able to shoot rockets out of the air==================================
*/

missile->clipmask = MASK_SHOT;
Expand Down

0 comments on commit 8225edd

Please sign in to comment.