mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-04-22 08:50:48 +00:00
This is a possible fix for #2. It changes the respawn function to act like a team change (e.g. spectator to player). I can't test this tough because I don't seem to be able to reproduce the crash.
This commit is contained in:
parent
a51e6fb305
commit
db393ab350
3 changed files with 1087 additions and 1073 deletions
File diff suppressed because it is too large
Load diff
|
@ -5524,18 +5524,30 @@ GSIO01 | 12/05/2009
|
|||
=================
|
||||
*/
|
||||
static void Cmd_Respawn_f(gentity_t *ent) {
|
||||
gentity_t *tent;
|
||||
if(!ent)
|
||||
int secondsToWait = 0;
|
||||
|
||||
if (ent == NULL) {
|
||||
return;
|
||||
if(!ent->client)
|
||||
return;
|
||||
|
||||
G_Client_Spawn(ent, 0, qfalse);
|
||||
if(ent->client->sess.sessionTeam != TEAM_SPECTATOR) {
|
||||
ent->client->ps.powerups[PW_QUAD] = level.time + 4000;
|
||||
tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TRANSPORT_IN );
|
||||
tent->s.clientNum = ent->s.clientNum;
|
||||
}
|
||||
|
||||
if (ent->client == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (level.time <= ent->client->respawnDisabledTime) {
|
||||
secondsToWait = ent->client->respawnDisabledTime - level.time;
|
||||
secondsToWait /= 1000;
|
||||
|
||||
if (secondsToWait) {
|
||||
G_PrintfClient(ent, "You just have respawned. Please wait %d seconds to respawn again.\n", secondsToWait);
|
||||
} else {
|
||||
G_PrintfClient(ent, "You just have respawned. Please wait. You will be able to respawn very soon.\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
G_Client_Begin(ent->client - level.clients, qfalse, qfalse, qfalse);
|
||||
ent->client->respawnDisabledTime = level.time += 5000;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -697,6 +697,8 @@ struct gclient_s {
|
|||
// for selfdestruct and shiphealth
|
||||
int nokilli; //!< if 1 this player won't be killed if the ship is killed
|
||||
int myship; //!< entnum of the shiphealth entity this client currently holds info from
|
||||
|
||||
int respawnDisabledTime;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue