Skip to content

Commit

Permalink
q3plus support
Browse files Browse the repository at this point in the history
  • Loading branch information
brugal committed Apr 10, 2023
1 parent 4f030a0 commit 151f37f
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 23 deletions.
17 changes: 16 additions & 1 deletion FIXME
Original file line number Diff line number Diff line change
Expand Up @@ -2407,12 +2407,27 @@ Q_GetCpFromUtf8 invalid number of bytes specified in utf8 character 255
* zf .mme support
* stopfresh github #45 cnq3 152 renderer features

* kr3m q3plus demo
* q3plus
- leader board
- unknown config string 30: 1
- rtf and ptl game types
- alive status freezetag
- older q3plus: Bad item index 36 on entity, ts_dm5 -- just ql version? -- also q3 version
- scores has kill weapon list?
- team overlay shows freeze percentage and changes color for frozen players
- g5rtf1.dm_68 has "vchat", "vtell"
- rtf flag status -- can have both and own team carrying own flag is different status
- info screen show rtf, ptl
- ca treated as end of game after rounds end, cs 30: 1 at real end?
- cap, score limits
- ptl not showing regen when you are the leader

* damageplumshack reset weapon switch only in demo? -- cg_playerstate.c
* damage plum check ql colors
* ui_demos2.c demo dir uses MAX_OSPATH which is only 256



----


Expand Down
2 changes: 1 addition & 1 deletion Makefile.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=12.6test5
VERSION=12.6test6

USE_CODEC_VORBIS=1
USE_FREETYPE=1
Expand Down
2 changes: 1 addition & 1 deletion README-wolfcam.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ Player Models:
* cg_itemSize
* cg_itemFx same as quake live

* quake3 demo playback support (vanilla q3 and specific support for cpma, osp, and defrag)
* quake3 demo playback support (vanilla q3 and specific support for cpma, osp, defrag, and some q3plus features)
ex: copy map_cpm3a.pk3 into wolfcamql/wolfcam-ql/
wolfcamql.exe +demo ratelpajuo

Expand Down
15 changes: 15 additions & 0 deletions code/cgame/cg_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ static void CG_Obituary( const entityState_t *ent ) {
attacker = ent->otherEntityNum2;
mod = ent->eventParm;

if (cgs.q3plus) {
if (mod == 0 && cgs.gametype == GT_FREEZETAG) {
mod = MOD_THAW;
}
}

if (attacker == ourClientNum && attacker != target && !cg.freecam && cg_killBeep.integer > 0 && cg_killBeep.integer <= 8) {
if (target >= 0 && target < MAX_CLIENTS && CG_IsEnemy(&cgs.clientinfo[target])) {
CG_StartLocalSound(cgs.media.killBeep[cg_killBeep.integer - 1], CHAN_KILLBEEP_SOUND);
Expand Down Expand Up @@ -3462,6 +3468,15 @@ void CG_EntityEvent( centity_t *cent, const vec3_t position ) {
//cent = &cg_entities[clientNum];
}

if (cgs.q3plus && cgs.gametype == GT_FREEZETAG) {
if (*EffectScripts.thawed) {
CG_FX_ThawPlayer(cent);
} else {
CG_ThawPlayer(cent);
}
break;
}

if (cgs.gametype == GT_FREEZETAG) {
Com_Printf("^5skipping extra gib....\n");
break;
Expand Down
10 changes: 10 additions & 0 deletions code/cgame/cg_freeze.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ qboolean CG_FreezeTagFrozen (int clientNum)
}
#endif

#if 0
if (cgs.q3plus) {
if (cg_entities[clientNum].currentState.powerups & (1 << PW_BATTLESUIT)) {
return qtrue;
} else {
return qfalse;
}
}
#endif

//if (cg_entities[clientNum].currentState.eFlags & EF_DEAD) {
//if (cg_entities[clientNum].currentState.weapon == WP_NONE) {
//if (cg_entities[clientNum].currentState.powerups & 0x8000) {
Expand Down
2 changes: 2 additions & 0 deletions code/cgame/cg_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ void CG_DrawInformation (qboolean loading)
Com_sprintf(buf, sizeof(buf), "cpma: %s", Info_ValueForKey(CG_ConfigString(CS_SERVERINFO), "server_gameplay"));
} else if (cgs.defrag) {
Com_sprintf(buf, sizeof(buf), "defrag");
} else if (cgs.q3plus) {
Com_sprintf(buf, sizeof(buf), "q3plus");
} else {
Com_sprintf(buf, sizeof(buf), "%s", CG_ConfigString(CS_GAME_VERSION));
}
Expand Down
4 changes: 4 additions & 0 deletions code/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ typedef struct {
// end override

qhandle_t countryFlag;
char countryCode[2]; // q3plus

char clanTag[MAX_QPATH * 2];
char whiteClanTag[MAX_QPATH];
char fullClanName[MAX_STRING_CHARS];
Expand Down Expand Up @@ -2510,6 +2512,8 @@ typedef struct {
qboolean osp;
qboolean ospEncrypt;
qboolean defrag;
qboolean q3plus;

//int cpmaTimeoutTime;
int cpmaLastTe;
int cpmaLastTd;
Expand Down
9 changes: 9 additions & 0 deletions code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8137,6 +8137,15 @@ static void CG_Init (int serverMessageNum, int serverCommandSequence, int client
cgs.defrag = qtrue;
} else if (*Info_ValueForKey(CG_ConfigString(CS_SERVERINFO), "defrag_vers")) {
cgs.defrag = qtrue;
} else if (!Q_stricmp("q3plus", Info_ValueForKey(CG_ConfigString(CS_SERVERINFO), "gamename"))
||

// saw in older demo
( !Q_stricmp("q3plus", Info_ValueForKey(CG_ConfigString(CS_SYSTEMINFO), "fs_game")) && !Q_stricmp("excessiveplus", Info_ValueForKey(CG_ConfigString(CS_SERVERINFO), "gamename")) )
) {
//FIXME gametypes
Com_Printf("^5q3plus detected\n");
cgs.q3plus = qtrue;
}
} else if (cgs.realProtocol == 73) {
memcpy(&bg_itemlist, &bg_itemlistQldm73, sizeof(gitem_t) * bg_numItemsQldm73);
Expand Down
4 changes: 2 additions & 2 deletions code/cgame/cg_newdraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static void CG_DrawPlayerAmmoValue (const rectDef_t *rect, float scale, const ve
value = cg.snap->ps.ammo[weapon];
}

if ( value > -1 ) {
if ( value > -1 && !(cgs.q3plus && value == Q3PLUS_INFINITE_AMMO)) {
if (shader) {
trap_R_SetColor( color );
CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader);
Expand Down Expand Up @@ -6338,7 +6338,7 @@ void CG_DrawWeaponBar( void ) {
Vector4Copy(colorWhite, textColor);
}

if (ammo < 0) {
if (ammo < 0 || (cgs.q3plus && ammo == Q3PLUS_INFINITE_AMMO)) {
trap_R_SetColor(colorWhite);
CG_DrawPic(x + 18, y , 16, 16, cgs.media.infiniteAmmo);
} else if (cg_weaponBar.integer == 1 || cg_weaponBar.integer == 3) {
Expand Down
7 changes: 6 additions & 1 deletion code/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -4281,7 +4281,12 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, const entityState_t *state,
}
}
if ( state->powerups & ( 1 << PW_BATTLESUIT ) ) {
ent->customShader = cgs.media.battleSuitShader;
if (cgs.q3plus && cgs.gametype == GT_FREEZETAG) {
// 2023-04-07 q3plus also disables battle suit in freetag
ent->customShader = cgs.media.iceShader[0]; //FIXME index
} else {
ent->customShader = cgs.media.battleSuitShader;
}
CG_AddRefEntity(ent);
}
if (CG_FreezeTagFrozen(state->clientNum) && ent->hModel != cg_weapons[WP_GRENADE_LAUNCHER].missileModel && ent->hModel != cg_weapons[WP_ROCKET_LAUNCHER].missileModel && ent->hModel != cg_weapons[WP_BFG].missileModel && ent->hModel != cg_weapons[WP_PROX_LAUNCHER].missileModel && ent->hModel != cgs.media.blueProxMine) {
Expand Down
Loading

0 comments on commit 151f37f

Please sign in to comment.