- fixed : crash when executing @adjustheight=force

Sun, 05 Jun 2011 12:48:53 +0200

author
Kitty Barnett <develop@catznip.com>
date
Sun, 05 Jun 2011 12:48:53 +0200
changeset 1668
a441202824f2
parent 1659
59082f7329bc
child 1669
3baef9e5526b

- fixed : crash when executing @adjustheight=force
-> affected every 12 letter command (12 - 13 = -1 == std::string::npos)

indra/newview/rlvhelper.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/rlvhelper.cpp	Tue Mar 06 11:53:44 2012 -0800
     1.2 +++ b/indra/newview/rlvhelper.cpp	Sun Jun 05 12:48:53 2011 +0200
     1.3 @@ -75,11 +75,16 @@
     1.4  	}
     1.5  
     1.6  	// HACK: all those @*overorreplace synonyms are rather tedious (and error-prone) to deal with so replace them their equivalent
     1.7 -	if ( (RLV_TYPE_FORCE == m_eParamType) && (m_strBehaviour.length() - 13 == m_strBehaviour.rfind("overorreplace")) )
     1.8 +	if ( (RLV_TYPE_FORCE == m_eParamType) && 
     1.9 +		 (m_strBehaviour.length() > 13) && (m_strBehaviour.length() - 13 == m_strBehaviour.rfind("overorreplace")) )
    1.10 +	{
    1.11  		m_strBehaviour.erase(m_strBehaviour.length() - 13, 13);
    1.12 +	}
    1.13  	// HACK: all those @addoutfit* synonyms are rather tedious (and error-prone) to deal with so replace them their @attach* equivalent
    1.14  	if ( (RLV_TYPE_FORCE == m_eParamType) && (0 == m_strBehaviour.find("addoutfit")) )
    1.15 +	{
    1.16  		m_strBehaviour.replace(0, 9, "attach");
    1.17 +	}
    1.18  	m_eBehaviour = getBehaviourFromString(m_strBehaviour, &m_fStrict);
    1.19  }
    1.20  

mercurial