Fix for STORM-1948; modified version of viewer-release's 683b1ecc6ce8255d31cad3c674ffaf87353c6469

To maintain compatibility with grids that still use the old home position set notification method, a common function is called.
The fix has also been applied for the special case of death teleports.
This commit is contained in:
Inusaito Sayori
2013-09-09 21:27:33 -04:00
parent e36c0095e0
commit 27b2f14193

View File

@@ -6457,6 +6457,15 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock)
return returnValue;
}
void home_position_set()
{
// save the home location image to disk
std::string snap_filename = gDirUtilp->getLindenUserDir();
snap_filename += gDirUtilp->getDirDelimiter();
snap_filename += SCREEN_HOME_FILENAME;
gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE);
}
bool attempt_standard_notification(LLMessageSystem* msgsystem)
{
// if we have additional alert data
@@ -6519,7 +6528,16 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
return true;
}
}
// HACK -- handle callbacks for specific alerts.
if (notificationID == "HomePositionSet")
{
home_position_set();
}
else if (notificationID == "YouDiedAndGotTPHome")
{
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT);
}
LLNotificationsUtil::add(notificationID, llsdBlock);
return true;
}
@@ -6596,11 +6614,7 @@ void process_alert_core(const std::string& message, BOOL modal)
}
else if( message == "Home position set." )
{
// save the home location image to disk
std::string snap_filename = gDirUtilp->getLindenUserDir();
snap_filename += gDirUtilp->getDirDelimiter();
snap_filename += SCREEN_HOME_FILENAME;
gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE);
home_position_set();
}
const std::string ALERT_PREFIX("ALERT: ");