Skip to content

Commit 36404b9

Browse files
committed
coop grip tweak
1 parent 89f4c78 commit 36404b9

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

codemp/game/g_misc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,15 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles, int speed)
251251
player->client->ps.powerups[PW_FORCE_BOON] = 0;
252252
if (player->client->sess.movementStyle == MV_RJQ3 || player->client->sess.movementStyle == MV_RJCPM) //Get rid of their rockets when they tele/noclip..?
253253
DeletePlayerProjectiles(player);
254+
if (player->client->sess.movementStyle == MV_COOP_JKA && player->client->ps.duelInProgress) { //clean this up..
255+
gentity_t* gripEnt;
256+
WP_ForcePowerStop(player, FP_GRIP);
257+
258+
gripEnt = &g_entities[player->client->ps.duelIndex];
259+
if (gripEnt && gripEnt->client) {
260+
WP_ForcePowerStop(gripEnt, FP_GRIP);
261+
}
262+
}
254263
}
255264
}
256265

codemp/game/w_force.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,8 +4169,13 @@ void DoGripAction(gentity_t *self, forcePowers_t forcePower)
41694169

41704170
if (VectorLength(a) > MAX_GRIP_DISTANCE)
41714171
{
4172-
WP_ForcePowerStop(self, forcePower);
4173-
return;
4172+
if (self && self->client->sess.movementStyle == MV_COOP_JKA) {
4173+
//dont break grips due to distance in coop
4174+
}
4175+
else {
4176+
WP_ForcePowerStop(self, forcePower);
4177+
return;
4178+
}
41744179
}
41754180

41764181
if ( !InFront( gripEnt->client->ps.origin, self->client->ps.origin, self->client->ps.viewangles, 0.9f ) &&
@@ -4316,13 +4321,24 @@ void DoGripAction(gentity_t *self, forcePowers_t forcePower)
43164321
}
43174322
else
43184323
{
4319-
VectorNormalize(nvel);
4320-
gripEnt->client->ps.velocity[0] = nvel[0]*700;
4321-
gripEnt->client->ps.velocity[1] = nvel[1]*700;
4322-
gripEnt->client->ps.velocity[2] = nvel[2]*700;
4324+
if (gripEnt->client->sess.movementStyle == MV_COOP_JKA) {
4325+
VectorNormalize(nvel);
4326+
gripEnt->client->ps.velocity[0] = nvel[0] * 1600;
4327+
gripEnt->client->ps.velocity[1] = nvel[1] * 1600;
4328+
gripEnt->client->ps.velocity[2] = nvel[2] * 1600;
4329+
}
4330+
else {
4331+
VectorNormalize(nvel);
4332+
gripEnt->client->ps.velocity[0] = nvel[0] * 700;
4333+
gripEnt->client->ps.velocity[1] = nvel[1] * 700;
4334+
gripEnt->client->ps.velocity[2] = nvel[2] * 700;
4335+
}
43234336
}
43244337

4325-
gripEnt->client->ps.forceGripMoveInterval = level.time + 300; //only update velocity every 300ms, so as to avoid heavy bandwidth usage
4338+
if (gripEnt->client->sess.movementStyle == MV_COOP_JKA)
4339+
gripEnt->client->ps.forceGripMoveInterval = level.time + 50; //only update velocity every 300ms, so as to avoid heavy bandwidth usage
4340+
else
4341+
gripEnt->client->ps.forceGripMoveInterval = level.time + 300; //only update velocity every 300ms, so as to avoid heavy bandwidth usage
43264342
}
43274343

43284344
if ((level.time - gripEnt->client->ps.fd.forceGripStarted) > 3000 && !self->client->ps.fd.forceGripDamageDebounceTime)

0 commit comments

Comments
 (0)