Added isAgentAvatarValid() helper function from v2

Nullchecks
Flight-state tweaks
This commit is contained in:
Shyotl
2011-03-25 17:50:06 -05:00
parent 39af56c6f7
commit f73c666f0e
7 changed files with 119 additions and 98 deletions

View File

@@ -372,7 +372,7 @@ void request_initial_instant_messages()
if (!requested
&& gMessageSystem
&& LLMuteList::getInstance()->isLoaded()
&& gAgent.getAvatarObject())
&& isAgentAvatarValid())
{
// Auto-accepted inventory items may require the avatar object
// to build a correct name. Likewise, inventory offers from
@@ -2635,26 +2635,27 @@ void LLAppViewer::initMarkerFile()
if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB))
{
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL;
gLastExecEvent = LAST_EXEC_LOGOUT_FROZE;
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
LLAPRFile::remove(logout_marker_file);
}
if(LLAPRFile::isExist(llerror_marker_file, LL_APR_RB))
{
llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl;
if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
else gLastExecEvent = LAST_EXEC_LLERROR_CRASH;
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
LLAPRFile::remove(llerror_marker_file);
}
if(LLAPRFile::isExist(error_marker_file, LL_APR_RB))
{
LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL;
if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
else gLastExecEvent = LAST_EXEC_OTHER_CRASH;
LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
LLAPRFile::remove(error_marker_file);
}
LLAPRFile::remove(logout_marker_file);
LLAPRFile::remove(llerror_marker_file);
LLAPRFile::remove(error_marker_file);
// No new markers if another instance is running.
if(anotherInstanceRunning())
{
@@ -3990,7 +3991,7 @@ void LLAppViewer::idleNetwork()
// Check that the circuit between the viewer and the agent's current
// region is still alive
LLViewerRegion *agent_region = gAgent.getRegion();
if (agent_region)
if (agent_region && (LLStartUp::getStartupState()==STATE_STARTED))
{
LLUUID this_region_id = agent_region->getRegionID();
bool this_region_alive = agent_region->isAlive();