mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-11 07:42:15 +00:00
Saving persistant and other data on some events..
This commit is contained in:
parent
2950d7d590
commit
644fd07f42
6 changed files with 40 additions and 16 deletions
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.52 2002/02/10 21:21:22 slicer
|
||||||
|
// Saving persistant and other data on some events..
|
||||||
|
//
|
||||||
// Revision 1.51 2002/02/10 18:38:42 jbravo
|
// Revision 1.51 2002/02/10 18:38:42 jbravo
|
||||||
// Added new SPECTATOR_ZCAM spec mode.
|
// Added new SPECTATOR_ZCAM spec mode.
|
||||||
//
|
//
|
||||||
|
@ -1533,7 +1536,8 @@ SpectatorClientEndFrame
|
||||||
*/
|
*/
|
||||||
void SpectatorClientEndFrame( gentity_t *ent ) {
|
void SpectatorClientEndFrame( gentity_t *ent ) {
|
||||||
gclient_t *cl;
|
gclient_t *cl;
|
||||||
int savedPing, savedScore,savedFlags;
|
int savedPing, savedFlags,i;
|
||||||
|
int savedPers[MAX_PERSISTANT];
|
||||||
|
|
||||||
// if we are doing a chase cam or a remote view, grab the latest info
|
// if we are doing a chase cam or a remote view, grab the latest info
|
||||||
if ( ent->client->sess.spectatorState == SPECTATOR_FOLLOW ) {
|
if ( ent->client->sess.spectatorState == SPECTATOR_FOLLOW ) {
|
||||||
|
@ -1553,18 +1557,21 @@ void SpectatorClientEndFrame( gentity_t *ent ) {
|
||||||
flags = (cl->ps.eFlags & ~(EF_VOTED | EF_TEAMVOTED)) | (ent->client->ps.eFlags & (EF_VOTED | EF_TEAMVOTED));
|
flags = (cl->ps.eFlags & ~(EF_VOTED | EF_TEAMVOTED)) | (ent->client->ps.eFlags & (EF_VOTED | EF_TEAMVOTED));
|
||||||
// JBravo: saving score and ping to fix the scoreboard
|
// JBravo: saving score and ping to fix the scoreboard
|
||||||
savedPing = ent->client->ps.ping;
|
savedPing = ent->client->ps.ping;
|
||||||
savedScore = ent->client->ps.persistant[PERS_SCORE];
|
//Slicer saving pm_flags & pers
|
||||||
//Slicer saving pm_flags
|
|
||||||
savedFlags = ent->client->ps.pm_flags;
|
savedFlags = ent->client->ps.pm_flags;
|
||||||
|
for (i = 0 ; i < MAX_PERSISTANT ; i++)
|
||||||
|
savedPers[i] = ent->client->ps.persistant[i];
|
||||||
|
//This will make the spectator get the client's stuff
|
||||||
ent->client->ps = cl->ps;
|
ent->client->ps = cl->ps;
|
||||||
//Reposting score and ping..
|
//Reposting score and ping..
|
||||||
if(g_gametype.integer == GT_TEAMPLAY) {
|
if(g_gametype.integer == GT_TEAMPLAY) {
|
||||||
|
for (i = 0 ; i < MAX_PERSISTANT ; i++)
|
||||||
|
ent->client->ps.persistant[i] = savedPers[i];
|
||||||
|
|
||||||
ent->client->ps.ping = savedPing;
|
ent->client->ps.ping = savedPing;
|
||||||
ent->client->ps.persistant[PERS_SCORE] = savedScore;
|
|
||||||
//Slicer reposting pmflags
|
//Slicer reposting pmflags
|
||||||
ent->client->ps.pm_flags = savedFlags;
|
ent->client->ps.pm_flags = savedFlags;
|
||||||
}
|
}
|
||||||
// ent->client->ps.persistant[PERS_SCORE] = ent->client->savedpersistant[PERS_SCORE];
|
|
||||||
ent->client->ps.pm_flags |= PMF_FOLLOW;
|
ent->client->ps.pm_flags |= PMF_FOLLOW;
|
||||||
ent->client->ps.eFlags = flags;
|
ent->client->ps.eFlags = flags;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.37 2002/02/10 21:21:22 slicer
|
||||||
|
// Saving persistant and other data on some events..
|
||||||
|
//
|
||||||
// Revision 1.36 2002/02/10 16:26:55 jbravo
|
// Revision 1.36 2002/02/10 16:26:55 jbravo
|
||||||
// Attempting to intergrate zcam better into rq3 and a fix for lights.wav
|
// Attempting to intergrate zcam better into rq3 and a fix for lights.wav
|
||||||
//
|
//
|
||||||
|
@ -1132,7 +1135,8 @@ void ClientBegin( int clientNum ) {
|
||||||
gentity_t *ent;
|
gentity_t *ent;
|
||||||
gclient_t *client;
|
gclient_t *client;
|
||||||
int flags;
|
int flags;
|
||||||
int savedPing,savedScore;
|
int savedPing,i;
|
||||||
|
int savedPers[MAX_PERSISTANT];
|
||||||
|
|
||||||
ent = g_entities + clientNum;
|
ent = g_entities + clientNum;
|
||||||
|
|
||||||
|
@ -1153,11 +1157,11 @@ void ClientBegin( int clientNum ) {
|
||||||
client->pers.sub = TEAM_FREE;
|
client->pers.sub = TEAM_FREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Slicer: Saving score and ping
|
//Slicer: Saving persistant and ping
|
||||||
savedPing = client->ps.ping;
|
savedPing = client->ps.ping;
|
||||||
savedScore = client->ps.persistant[PERS_SCORE];
|
for ( i = 0 ; i < MAX_PERSISTANT ; i++ )
|
||||||
|
savedPers[i] = client->ps.persistant[i];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
client->pers.connected = CON_CONNECTED;
|
client->pers.connected = CON_CONNECTED;
|
||||||
client->pers.enterTime = level.time;
|
client->pers.enterTime = level.time;
|
||||||
|
@ -1175,7 +1179,8 @@ void ClientBegin( int clientNum ) {
|
||||||
//Slicer: Repost score and ping
|
//Slicer: Repost score and ping
|
||||||
if(g_gametype.integer == GT_TEAMPLAY) {
|
if(g_gametype.integer == GT_TEAMPLAY) {
|
||||||
client->ps.ping = savedPing;
|
client->ps.ping = savedPing;
|
||||||
client->ps.persistant[PERS_SCORE] = savedScore;
|
for ( i = 0 ; i < MAX_PERSISTANT ; i++ )
|
||||||
|
client->ps.persistant[i] = savedPers[i];
|
||||||
}
|
}
|
||||||
// locate ent at a spawn point
|
// locate ent at a spawn point
|
||||||
ClientSpawn( ent );
|
ClientSpawn( ent );
|
||||||
|
@ -1336,7 +1341,7 @@ void ClientSpawn(gentity_t *ent) {
|
||||||
|
|
||||||
for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
|
for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
|
||||||
persistant[i] = client->ps.persistant[i];
|
persistant[i] = client->ps.persistant[i];
|
||||||
savedpers[i] = client->savedpersistant[i];
|
// savedpers[i] = client->savedpersistant[i];
|
||||||
}
|
}
|
||||||
eventSequence = client->ps.eventSequence;
|
eventSequence = client->ps.eventSequence;
|
||||||
|
|
||||||
|
@ -1360,7 +1365,7 @@ void ClientSpawn(gentity_t *ent) {
|
||||||
|
|
||||||
for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
|
for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
|
||||||
client->ps.persistant[i] = persistant[i];
|
client->ps.persistant[i] = persistant[i];
|
||||||
client->savedpersistant[i] = savedpers[i];
|
// client->savedpersistant[i] = savedpers[i];
|
||||||
}
|
}
|
||||||
client->ps.eventSequence = eventSequence;
|
client->ps.eventSequence = eventSequence;
|
||||||
// increment the spawncount so the client will detect the respawn
|
// increment the spawncount so the client will detect the respawn
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.42 2002/02/10 21:21:23 slicer
|
||||||
|
// Saving persistant and other data on some events..
|
||||||
|
//
|
||||||
// Revision 1.41 2002/02/07 23:31:22 niceass
|
// Revision 1.41 2002/02/07 23:31:22 niceass
|
||||||
// fixed a bug in G_Combat that assumed pointers waren't NULL (only in DLLs was it a problem)
|
// fixed a bug in G_Combat that assumed pointers waren't NULL (only in DLLs was it a problem)
|
||||||
//
|
//
|
||||||
|
@ -614,11 +617,11 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||||
}
|
}
|
||||||
|
|
||||||
// JBravo: save client->ps so spectating wont zap it.
|
// JBravo: save client->ps so spectating wont zap it.
|
||||||
if (g_gametype.integer == GT_TEAMPLAY) {
|
/* if (g_gametype.integer == GT_TEAMPLAY) {
|
||||||
for (i = 0 ; i < MAX_PERSISTANT ; i++) {
|
for (i = 0 ; i < MAX_PERSISTANT ; i++) {
|
||||||
self->client->savedpersistant[i] = self->client->ps.persistant[i];
|
self->client->savedpersistant[i] = self->client->ps.persistant[i];
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.47 2002/02/10 21:21:23 slicer
|
||||||
|
// Saving persistant and other data on some events..
|
||||||
|
//
|
||||||
// Revision 1.46 2002/02/10 18:38:42 jbravo
|
// Revision 1.46 2002/02/10 18:38:42 jbravo
|
||||||
// Added new SPECTATOR_ZCAM spec mode.
|
// Added new SPECTATOR_ZCAM spec mode.
|
||||||
//
|
//
|
||||||
|
@ -529,7 +532,7 @@ struct gclient_s {
|
||||||
// JBravo adding TP stuff
|
// JBravo adding TP stuff
|
||||||
int teamplayWeapon;
|
int teamplayWeapon;
|
||||||
int teamplayItem;
|
int teamplayItem;
|
||||||
int savedpersistant[MAX_PERSISTANT];
|
// int savedpersistant[MAX_PERSISTANT];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,10 @@ set cc=call ..\compile.bat
|
||||||
@if errorlevel 1 goto quit
|
@if errorlevel 1 goto quit
|
||||||
%cc% ../rxn_game.c
|
%cc% ../rxn_game.c
|
||||||
@if errorlevel 1 goto quit
|
@if errorlevel 1 goto quit
|
||||||
|
%cc% ../zcam.c
|
||||||
|
@if errorlevel 1 goto quit
|
||||||
|
%cc% ../zcam_target.c
|
||||||
|
@if errorlevel 1 goto quit
|
||||||
|
|
||||||
|
|
||||||
q3asm -f ../game
|
q3asm -f ../game
|
||||||
|
|
|
@ -36,4 +36,6 @@ g_trigger
|
||||||
g_utils
|
g_utils
|
||||||
g_weapon
|
g_weapon
|
||||||
g_fileio
|
g_fileio
|
||||||
rxn_game
|
rxn_game
|
||||||
|
zcam
|
||||||
|
zcam_target
|
Loading…
Reference in a new issue