## ETPub PCR alpha hacks (etpub_pcr_ah) ## (C) 2006-2007 PatheticCockroach.com ## This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License ## Derivative works may only be done if they are distributed with their source code. ## ## The original etpub_pcr_ah source and binaries can be found around http://www.patheticcockroach.com/etserver/etpub_pcr.php ## ## Note : ETPub PCR alpha hacks are just small modifications for ETPub (http://www.etpub.org) Bugfix : g_spawnInvulFair didn't work when you just "use" (action key - default F) stuff. Also added : g_ssGrace : Time, in milliseconds, during which you can shoot without losing your spawn shield after spawning. Default : 500 ------------------------- MODIFICATION STARTS HERE src\game\g_local.h (line 1657) **** AFTER qboolean G_DisguisedCovertFire_Bar(gentity_t *ent, qboolean keepUni); **** ADD void G_SpawnShieldFire(gentity_t* ent); src\game\g_weapon.c (line 4629) **** BEFORE // covert ops disguise handling related to weapon fire void G_DisguisedCovertFire(gentity_t *ent) **** ADD // etpub_pcr_ah : shall we remove spawn protection ? void G_SpawnShieldFire(gentity_t* ent) { if(ent->client->ps.powerups[PW_INVULNERABLE] >= level.time && (ent->client->ps.powerups[PW_INVULNERABLE] - level.time) < (g_spawnInvul.integer*1000-g_ssGrace.integer) && g_spawnInvulFair.integer==1) { ent->client->ps.powerups[PW_INVULNERABLE] = level.time - 100; // And tell the player if(g_noobTips.integer==1) CP("cp \"You lost your spawn protection\""); } return; } (line 4720) **** REPLACE // Remove spawn protection if(ent->client->ps.powerups[PW_INVULNERABLE] >= level.time && g_spawnInvulFair.integer==1) { ent->client->ps.powerups[PW_INVULNERABLE] = level.time - 100; // And tell the player if(g_noobTips.integer==1) CP("cp \"You lost your spawn protection\""); } **** WITH // PatheticCockroach : remove spawn shield ? G_SpawnShieldFire(ent); **** AND MOVE IT BEFORE // Rafael mg42 if (ent->client->ps.persistant[PERS_HWEAPON_USE] && ent->active) { return; } src\game\g_cmds.c (line 4734) **** AFTER void Cmd_Activate_f( gentity_t *ent ) { trace_t tr; vec3_t end; gentity_t *traceEnt; vec3_t forward, right, up, offset; // int activatetime = level.time; qboolean found = qfalse; qboolean pass2 = qfalse; int i; if( ent->health <= 0 ) { return; } **** ADD // PatheticCockroach : remove spawn shield ? G_SpawnShieldFire(ent); src\game\g_cmds.c (line 4831) **** AFTER void Cmd_Activate2_f( gentity_t *ent ) { trace_t tr; vec3_t end; gentity_t *traceEnt; vec3_t forward, right, up, offset; //if( ent->client->sess.playerType != PC_COVERTOPS ) { // return; //} **** ADD // PatheticCockroach : remove spawn shield ? G_SpawnShieldFire(ent); src\game\g_local.h : (line 2182) **** AFTER extern vmCvar_t g_spawnInvul; **** ADDED extern vmCvar_t g_ssGrace; src\game\g_main.c : (line 259) **** AFTER vmCvar_t g_spawnInvul; **** ADD vmCvar_t g_ssGrace; (line 789) **** AFTER { &g_spawnInvul, "g_spawnInvul", "3", 0 }, **** ADD { &g_ssGrace, "g_ssGrace", "500", 0 }, ------------------------- PERSONAL NOTES void Cmd_Activate2_f( gentity_t *ent ) { // Remove spawn protection if(ent->client->ps.powerups[PW_INVULNERABLE] >= level.time && g_spawnInvulFair.integer==1) { ent->client->ps.powerups[PW_INVULNERABLE] = level.time - 100; // And tell the player if(g_noobTips.integer==1) CP("cp \"You lost your spawn protection\""); }