o Reverted the throttling of players on entity reset

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@454 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
tankefugl 2006-05-06 20:24:14 +00:00
parent a8372fca14
commit 01ead2bf70
1 changed files with 36 additions and 23 deletions

View File

@ -2700,33 +2700,45 @@ void AvHGamerules::ResetEntities()
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(theBaseEntity); AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(theBaseEntity);
if(thePlayer && (thePlayer->GetPlayMode() == PLAYMODE_READYROOM)) // && (thePlayer->GetHasSeenATeam())) if(thePlayer && (thePlayer->GetPlayMode() == PLAYMODE_READYROOM)) // && (thePlayer->GetHasSeenATeam()))
{ {
// SNIP int theUser3 = thePlayer->pev->iuser3;
int theUser4 = thePlayer->pev->iuser4;
int thePlayMode = thePlayer->pev->playerclass;
int thePlayerTeam = thePlayer->pev->team;
int theSolidType = thePlayer->pev->solid;
thePlayer->ResetEntity();
thePlayer->pev->iuser3 = theUser3;
thePlayer->pev->iuser4 = theUser4;
thePlayer->pev->playerclass = thePlayMode;
thePlayer->pev->team = thePlayerTeam;
thePlayer->pev->solid = theSolidType;
} }
else else
{ {
theBaseEntity->ResetEntity(); theBaseEntity->ResetEntity();
}
// Don't mark commander stations as useable in this case // Don't mark commander stations as useable in this case
AvHCommandStation* theCommandStation = dynamic_cast<AvHCommandStation*>(theBaseEntity); AvHCommandStation* theCommandStation = dynamic_cast<AvHCommandStation*>(theBaseEntity);
if(!theCommandStation) if(!theCommandStation)
{
int theObjectCaps = theBaseEntity->ObjectCaps();
if(theObjectCaps & (FCAP_IMPULSE_USE | FCAP_CONTINUOUS_USE | FCAP_ONOFF_USE))
{ {
int theObjectCaps = theBaseEntity->ObjectCaps(); // After playing once, this is no longer zero
if(theObjectCaps & (FCAP_IMPULSE_USE | FCAP_CONTINUOUS_USE | FCAP_ONOFF_USE)) if(theBaseEntity->pev->iuser3 == 0)
{ {
// After playing once, this is no longer zero theBaseEntity->pev->iuser3 = AVH_USER3_USEABLE;
if(theBaseEntity->pev->iuser3 == 0)
// Now also mark the target entity as useable!
if (!FStringNull(theBaseEntity->pev->target))
{ {
theBaseEntity->pev->iuser3 = AVH_USER3_USEABLE; CBaseEntity* theTarget = NULL;
// Now also mark the target entity as useable! while(theTarget = UTIL_FindEntityByTargetname(theTarget, STRING(theBaseEntity->pev->target)))
if (!FStringNull(theBaseEntity->pev->target))
{ {
CBaseEntity* theTarget = NULL; theTarget->pev->iuser3 = AVH_USER3_USEABLE;
while(theTarget = UTIL_FindEntityByTargetname(theTarget, STRING(theBaseEntity->pev->target)))
{
theTarget->pev->iuser3 = AVH_USER3_USEABLE;
}
} }
} }
} }
@ -3227,12 +3239,13 @@ void AvHGamerules::Think(void)
this->mFirstUpdate = false; this->mFirstUpdate = false;
} }
const float playerResetDelay = 0.3f; // ResetPlayer throttling, commented out for now
if(this->mHasPlayersToReset && (this->mLastPlayerResetTime + playerResetDelay < theTime) ) // const float playerResetDelay = 0.3f;
{ // if(this->mHasPlayersToReset && (this->mLastPlayerResetTime + playerResetDelay < theTime) )
this->ResetPlayers(); // {
this->mLastPlayerResetTime = theTime; // this->ResetPlayers();
} // this->mLastPlayerResetTime = theTime;
// }
// Handle queued network messages // Handle queued network messages
#ifdef USE_NETWORK_METERING #ifdef USE_NETWORK_METERING