@ -95,24 +95,24 @@ namespace
int i = 0 ;
int i = 0 ;
for ( ; i < static_cast < int > ( script - > v arNames. size ( ) ) ; + + i )
for ( ; i < static_cast < int > ( script - > mV arNames. size ( ) ) ; + + i )
if ( script - > v arNames[ i ] = = name )
if ( script - > mV arNames[ i ] = = name )
break ;
break ;
if ( i > = static_cast < int > ( script - > v arNames. size ( ) ) )
if ( i > = static_cast < int > ( script - > mV arNames. size ( ) ) )
return false ; // script does not have a variable of this name
return false ; // script does not have a variable of this name
const MWScript : : Locals & locals = actor . getRefData ( ) . getLocals ( ) ;
const MWScript : : Locals & locals = actor . getRefData ( ) . getLocals ( ) ;
if ( i < script - > data. n umShorts)
if ( i < script - > mData. mN umShorts)
return selectCompare ( comp , locals . mShorts [ i ] , value ) ;
return selectCompare ( comp , locals . mShorts [ i ] , value ) ;
else
else
i - = script - > data. n umShorts;
i - = script - > mData. mN umShorts;
if ( i < script - > data. n umLongs)
if ( i < script - > mData. mN umLongs)
return selectCompare ( comp , locals . mLongs [ i ] , value ) ;
return selectCompare ( comp , locals . mLongs [ i ] , value ) ;
else
else
i - = script - > data. n umShorts;
i - = script - > mData. mN umShorts;
return selectCompare ( comp , locals . mFloats . at ( i ) , value ) ;
return selectCompare ( comp , locals . mFloats . at ( i ) , value ) ;
}
}
@ -160,16 +160,16 @@ namespace MWDialogue
{
{
bool isCreature = ( actor . getTypeName ( ) ! = typeid ( ESM : : NPC ) . name ( ) ) ;
bool isCreature = ( actor . getTypeName ( ) ! = typeid ( ESM : : NPC ) . name ( ) ) ;
for ( std : : vector < ESM : : DialInfo : : SelectStruct > : : const_iterator iter ( info . s elects. begin ( ) ) ;
for ( std : : vector < ESM : : DialInfo : : SelectStruct > : : const_iterator iter ( info . mS elects. begin ( ) ) ;
iter ! = info . s elects. end ( ) ; + + iter )
iter ! = info . mS elects. end ( ) ; + + iter )
{
{
ESM : : DialInfo : : SelectStruct select = * iter ;
ESM : : DialInfo : : SelectStruct select = * iter ;
char type = select . s electRule[ 1 ] ;
char type = select . mS electRule[ 1 ] ;
if ( type = = ' 1 ' )
if ( type = = ' 1 ' )
{
{
char comp = select . s electRule[ 4 ] ;
char comp = select . mS electRule[ 4 ] ;
std : : string name = select . s electRule. substr ( 5 ) ;
std : : string name = select . mS electRule. substr ( 5 ) ;
std : : string function = select . s electRule. substr ( 2 , 2 ) ;
std : : string function = select . mS electRule. substr ( 2 , 2 ) ;
int ifunction ;
int ifunction ;
std : : istringstream iss ( function ) ;
std : : istringstream iss ( function ) ;
@ -177,19 +177,19 @@ namespace MWDialogue
switch ( ifunction )
switch ( ifunction )
{
{
case 39 : //PC Expelled
case 39 : //PC Expelled
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 40 : //PC Common Disease
case 40 : //PC Common Disease
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 41 : //PC Blight Disease
case 41 : //PC Blight Disease
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 43 : //PC Crime level
case 43 : //PC Crime level
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 46 : //Same faction
case 46 : //Same faction
@ -205,71 +205,71 @@ namespace MWDialogue
std : : string NPCFaction = NPCstats . getFactionRanks ( ) . begin ( ) - > first ;
std : : string NPCFaction = NPCstats . getFactionRanks ( ) . begin ( ) - > first ;
if ( PCstats . getFactionRanks ( ) . find ( toLower ( NPCFaction ) ) ! = PCstats . getFactionRanks ( ) . end ( ) ) sameFaction = 1 ;
if ( PCstats . getFactionRanks ( ) . find ( toLower ( NPCFaction ) ) ! = PCstats . getFactionRanks ( ) . end ( ) ) sameFaction = 1 ;
}
}
if ( ! selectCompare < int , int > ( comp , sameFaction , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , sameFaction , select . mI ) ) return false ;
}
}
break ;
break ;
case 48 : //Detected
case 48 : //Detected
if ( ! selectCompare < int , int > ( comp , 1 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 1 , select . mI ) ) return false ;
break ;
break ;
case 49 : //Alarmed
case 49 : //Alarmed
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 50 : //choice
case 50 : //choice
if ( choice )
if ( choice )
{
{
if ( ! selectCompare < int , int > ( comp , mChoice , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , mChoice , select . mI ) ) return false ;
}
}
break ;
break ;
case 60 : //PC Vampire
case 60 : //PC Vampire
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 61 : //Level
case 61 : //Level
if ( ! selectCompare < int , int > ( comp , 1 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 1 , select . mI ) ) return false ;
break ;
break ;
case 62 : //Attacked
case 62 : //Attacked
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 63 : //Talked to PC
case 63 : //Talked to PC
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 64 : //PC Health
case 64 : //PC Health
if ( ! selectCompare < int , int > ( comp , 50 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 50 , select . mI ) ) return false ;
break ;
break ;
case 65 : //Creature target
case 65 : //Creature target
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 66 : //Friend hit
case 66 : //Friend hit
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 67 : //Fight
case 67 : //Fight
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 68 : //Hello????
case 68 : //Hello????
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 69 : //Alarm
case 69 : //Alarm
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 70 : //Flee
case 70 : //Flee
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
case 71 : //Should Attack
case 71 : //Should Attack
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
break ;
break ;
default :
default :
@ -287,13 +287,13 @@ namespace MWDialogue
{
{
bool isCreature = ( actor . getTypeName ( ) ! = typeid ( ESM : : NPC ) . name ( ) ) ;
bool isCreature = ( actor . getTypeName ( ) ! = typeid ( ESM : : NPC ) . name ( ) ) ;
char type = select . s electRule[ 1 ] ;
char type = select . mS electRule[ 1 ] ;
if ( type ! = ' 0 ' )
if ( type ! = ' 0 ' )
{
{
char comp = select . s electRule[ 4 ] ;
char comp = select . mS electRule[ 4 ] ;
std : : string name = select . s electRule. substr ( 5 ) ;
std : : string name = select . mS electRule. substr ( 5 ) ;
std : : string function = select . s electRule. substr ( 1 , 2 ) ;
std : : string function = select . mS electRule. substr ( 1 , 2 ) ;
switch ( type )
switch ( type )
{
{
@ -303,15 +303,15 @@ namespace MWDialogue
case ' 2 ' : // global
case ' 2 ' : // global
if ( select . t ype= = ESM : : VT_Short | | select . t ype= = ESM : : VT_Int | |
if ( select . mT ype= = ESM : : VT_Short | | select . mT ype= = ESM : : VT_Int | |
select . t ype= = ESM : : VT_Long )
select . mT ype= = ESM : : VT_Long )
{
{
if ( ! checkGlobal ( comp , toLower ( name ) , select . i ) )
if ( ! checkGlobal ( comp , toLower ( name ) , select . mI ) )
return false ;
return false ;
}
}
else if ( select . t ype= = ESM : : VT_Float )
else if ( select . mT ype= = ESM : : VT_Float )
{
{
if ( ! checkGlobal ( comp , toLower ( name ) , select . f ) )
if ( ! checkGlobal ( comp , toLower ( name ) , select . mF ) )
return false ;
return false ;
}
}
else
else
@ -322,16 +322,16 @@ namespace MWDialogue
case ' 3 ' : // local
case ' 3 ' : // local
if ( select . t ype= = ESM : : VT_Short | | select . t ype= = ESM : : VT_Int | |
if ( select . mT ype= = ESM : : VT_Short | | select . mT ype= = ESM : : VT_Int | |
select . t ype= = ESM : : VT_Long )
select . mT ype= = ESM : : VT_Long )
{
{
if ( ! checkLocal ( comp , toLower ( name ) , select . i , actor ,
if ( ! checkLocal ( comp , toLower ( name ) , select . mI , actor ,
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
return false ;
return false ;
}
}
else if ( select . t ype= = ESM : : VT_Float )
else if ( select . mT ype= = ESM : : VT_Float )
{
{
if ( ! checkLocal ( comp , toLower ( name ) , select . f , actor ,
if ( ! checkLocal ( comp , toLower ( name ) , select . mF , actor ,
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
return false ;
return false ;
}
}
@ -342,9 +342,9 @@ namespace MWDialogue
return true ;
return true ;
case ' 4 ' : //journal
case ' 4 ' : //journal
if ( select . t ype= = ESM : : VT_Int )
if ( select . mT ype= = ESM : : VT_Int )
{
{
if ( ! selectCompare < int , int > ( comp , MWBase : : Environment : : get ( ) . getJournal ( ) - > getJournalIndex ( toLower ( name ) ) , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , MWBase : : Environment : : get ( ) . getJournal ( ) - > getJournalIndex ( toLower ( name ) ) , select . mI ) ) return false ;
}
}
else
else
throw std : : runtime_error (
throw std : : runtime_error (
@ -360,22 +360,22 @@ namespace MWDialogue
int sum = 0 ;
int sum = 0 ;
for ( MWWorld : : ContainerStoreIterator iter ( store . begin ( ) ) ; iter ! = store . end ( ) ; + + iter )
for ( MWWorld : : ContainerStoreIterator iter ( store . begin ( ) ) ; iter ! = store . end ( ) ; + + iter )
if ( toLower ( iter - > getCellRef ( ) . r efID) = = toLower ( name ) )
if ( toLower ( iter - > getCellRef ( ) . mR efID) = = toLower ( name ) )
sum + = iter - > getRefData ( ) . getCount ( ) ;
sum + = iter - > getRefData ( ) . getCount ( ) ;
if ( ! selectCompare < int , int > ( comp , sum , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , sum , select . mI ) ) return false ;
}
}
return true ;
return true ;
case ' 6 ' : //dead
case ' 6 ' : //dead
if ( ! selectCompare < int , int > ( comp , 0 , select . i ) ) return false ;
if ( ! selectCompare < int , int > ( comp , 0 , select . mI ) ) return false ;
case ' 7 ' : // not ID
case ' 7 ' : // not ID
if ( select . t ype= = ESM : : VT_String | | select . t ype= = ESM : : VT_Int ) //bug in morrowind here? it's not a short, it's a string
if ( select . mT ype= = ESM : : VT_String | | select . mT ype= = ESM : : VT_Int ) //bug in morrowind here? it's not a short, it's a string
{
{
int isID = int ( toLower ( name ) = = toLower ( MWWorld : : Class : : get ( actor ) . getId ( actor ) ) ) ;
int isID = int ( toLower ( name ) = = toLower ( MWWorld : : Class : : get ( actor ) . getId ( actor ) ) ) ;
if ( selectCompare < int , int > ( comp , ! isID , select . i ) ) return false ;
if ( selectCompare < int , int > ( comp , ! isID , select . mI ) ) return false ;
}
}
else
else
throw std : : runtime_error (
throw std : : runtime_error (
@ -387,11 +387,11 @@ namespace MWDialogue
if ( isCreature )
if ( isCreature )
return false ;
return false ;
if ( select . t ype= = ESM : : VT_Int )
if ( select . mT ype= = ESM : : VT_Int )
{
{
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
int isFaction = int ( toLower ( npc - > base - > f action) = = toLower ( name ) ) ;
int isFaction = int ( toLower ( npc - > base - > mF action) = = toLower ( name ) ) ;
if ( selectCompare < int , int > ( comp , ! isFaction , select . i ) )
if ( selectCompare < int , int > ( comp , ! isFaction , select . mI ) )
return false ;
return false ;
}
}
else
else
@ -404,11 +404,11 @@ namespace MWDialogue
if ( isCreature )
if ( isCreature )
return false ;
return false ;
if ( select . t ype= = ESM : : VT_Int )
if ( select . mT ype= = ESM : : VT_Int )
{
{
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
int isClass = int ( toLower ( npc - > base - > cl s) = = toLower ( name ) ) ;
int isClass = int ( toLower ( npc - > base - > mClas s) = = toLower ( name ) ) ;
if ( selectCompare < int , int > ( comp , ! isClass , select . i ) )
if ( selectCompare < int , int > ( comp , ! isClass , select . mI ) )
return false ;
return false ;
}
}
else
else
@ -421,11 +421,11 @@ namespace MWDialogue
if ( isCreature )
if ( isCreature )
return false ;
return false ;
if ( select . t ype= = ESM : : VT_Int )
if ( select . mT ype= = ESM : : VT_Int )
{
{
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
int isRace = int ( toLower ( npc - > base - > r ace) = = toLower ( name ) ) ;
int isRace = int ( toLower ( npc - > base - > mR ace) = = toLower ( name ) ) ;
if ( selectCompare < int , int > ( comp , ! isRace , select . i ) )
if ( selectCompare < int , int > ( comp , ! isRace , select . mI ) )
return false ;
return false ;
}
}
else
else
@ -435,10 +435,10 @@ namespace MWDialogue
return true ;
return true ;
case ' B ' : //not Cell
case ' B ' : //not Cell
if ( select . t ype= = ESM : : VT_Int )
if ( select . mT ype= = ESM : : VT_Int )
{
{
int isCell = int ( toLower ( actor . getCell ( ) - > cell - > n ame) = = toLower ( name ) ) ;
int isCell = int ( toLower ( actor . getCell ( ) - > cell - > mN ame) = = toLower ( name ) ) ;
if ( selectCompare < int , int > ( comp , ! isCell , select . i ) )
if ( selectCompare < int , int > ( comp , ! isCell , select . mI ) )
return false ;
return false ;
}
}
else
else
@ -447,16 +447,16 @@ namespace MWDialogue
return true ;
return true ;
case ' C ' : //not local
case ' C ' : //not local
if ( select . t ype= = ESM : : VT_Short | | select . t ype= = ESM : : VT_Int | |
if ( select . mT ype= = ESM : : VT_Short | | select . mT ype= = ESM : : VT_Int | |
select . t ype= = ESM : : VT_Long )
select . mT ype= = ESM : : VT_Long )
{
{
if ( checkLocal ( comp , toLower ( name ) , select . i , actor ,
if ( checkLocal ( comp , toLower ( name ) , select . mI , actor ,
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
return false ;
return false ;
}
}
else if ( select . t ype= = ESM : : VT_Float )
else if ( select . mT ype= = ESM : : VT_Float )
{
{
if ( checkLocal ( comp , toLower ( name ) , select . f , actor ,
if ( checkLocal ( comp , toLower ( name ) , select . mF , actor ,
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ) )
return false ;
return false ;
}
}
@ -480,12 +480,12 @@ namespace MWDialogue
bool isCreature = ( actor . getTypeName ( ) ! = typeid ( ESM : : NPC ) . name ( ) ) ;
bool isCreature = ( actor . getTypeName ( ) ! = typeid ( ESM : : NPC ) . name ( ) ) ;
// actor id
// actor id
if ( ! info . a ctor. empty ( ) )
if ( ! info . mA ctor. empty ( ) )
if ( toLower ( info . a ctor) ! = MWWorld : : Class : : get ( actor ) . getId ( actor ) )
if ( toLower ( info . mA ctor) ! = MWWorld : : Class : : get ( actor ) . getId ( actor ) )
return false ;
return false ;
//NPC race
//NPC race
if ( ! info . r ace. empty ( ) )
if ( ! info . mR ace. empty ( ) )
{
{
if ( isCreature )
if ( isCreature )
return false ;
return false ;
@ -495,12 +495,12 @@ namespace MWDialogue
if ( ! cellRef )
if ( ! cellRef )
return false ;
return false ;
if ( toLower ( info . r ace) ! = toLower ( cellRef - > base - > r ace) )
if ( toLower ( info . mR ace) ! = toLower ( cellRef - > base - > mR ace) )
return false ;
return false ;
}
}
//NPC class
//NPC class
if ( ! info . cla s. empty ( ) )
if ( ! info . mClas s. empty ( ) )
{
{
if ( isCreature )
if ( isCreature )
return false ;
return false ;
@ -510,23 +510,23 @@ namespace MWDialogue
if ( ! cellRef )
if ( ! cellRef )
return false ;
return false ;
if ( toLower ( info . cla s) ! = toLower ( cellRef - > base - > cl s) )
if ( toLower ( info . mClas s) ! = toLower ( cellRef - > base - > mClas s) )
return false ;
return false ;
}
}
//NPC faction
//NPC faction
if ( ! info . n pcFaction. empty ( ) )
if ( ! info . mN pcFaction. empty ( ) )
{
{
if ( isCreature )
if ( isCreature )
return false ;
return false ;
//MWWorld::Class npcClass = MWWorld::Class::get(actor);
//MWWorld::Class npcClass = MWWorld::Class::get(actor);
MWMechanics : : NpcStats stats = MWWorld : : Class : : get ( actor ) . getNpcStats ( actor ) ;
MWMechanics : : NpcStats stats = MWWorld : : Class : : get ( actor ) . getNpcStats ( actor ) ;
std : : map < std : : string , int > : : iterator it = stats . getFactionRanks ( ) . find ( toLower ( info . n pcFaction) ) ;
std : : map < std : : string , int > : : iterator it = stats . getFactionRanks ( ) . find ( toLower ( info . mN pcFaction) ) ;
if ( it ! = stats . getFactionRanks ( ) . end ( ) )
if ( it ! = stats . getFactionRanks ( ) . end ( ) )
{
{
//check rank
//check rank
if ( it - > second < ( int ) info . data. r ank) return false ;
if ( it - > second < ( int ) info . mData. mR ank) return false ;
}
}
else
else
{
{
@ -536,14 +536,14 @@ namespace MWDialogue
}
}
// TODO check player faction
// TODO check player faction
if ( ! info . p cFaction. empty ( ) )
if ( ! info . mP cFaction. empty ( ) )
{
{
MWMechanics : : NpcStats stats = MWWorld : : Class : : get ( MWBase : : Environment : : get ( ) . getWorld ( ) - > getPlayer ( ) . getPlayer ( ) ) . getNpcStats ( MWBase : : Environment : : get ( ) . getWorld ( ) - > getPlayer ( ) . getPlayer ( ) ) ;
MWMechanics : : NpcStats stats = MWWorld : : Class : : get ( MWBase : : Environment : : get ( ) . getWorld ( ) - > getPlayer ( ) . getPlayer ( ) ) . getNpcStats ( MWBase : : Environment : : get ( ) . getWorld ( ) - > getPlayer ( ) . getPlayer ( ) ) ;
std : : map < std : : string , int > : : iterator it = stats . getFactionRanks ( ) . find ( toLower ( info . p cFaction) ) ;
std : : map < std : : string , int > : : iterator it = stats . getFactionRanks ( ) . find ( toLower ( info . mP cFaction) ) ;
if ( it ! = stats . getFactionRanks ( ) . end ( ) )
if ( it ! = stats . getFactionRanks ( ) . end ( ) )
{
{
//check rank
//check rank
if ( it - > second < ( int ) info . data. PCrank) return false ;
if ( it - > second < ( int ) info . mData. m PCrank) return false ;
}
}
else
else
{
{
@ -556,24 +556,24 @@ namespace MWDialogue
if ( ! isCreature )
if ( ! isCreature )
{
{
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
MWWorld : : LiveCellRef < ESM : : NPC > * npc = actor . get < ESM : : NPC > ( ) ;
if ( npc - > base - > flags& npc - > base - > Female )
if ( npc - > base - > mFlags & npc - > base - > Female )
{
{
if ( static_cast < int > ( info . data. g ender) = = 0 ) return false ;
if ( static_cast < int > ( info . mData. mG ender) = = 0 ) return false ;
}
}
else
else
{
{
if ( static_cast < int > ( info . data. g ender) = = 1 ) return false ;
if ( static_cast < int > ( info . mData. mG ender) = = 1 ) return false ;
}
}
}
}
// check cell
// check cell
if ( ! info . c ell. empty ( ) )
if ( ! info . mC ell. empty ( ) )
if ( MWBase : : Environment : : get ( ) . getWorld ( ) - > getPlayer ( ) . getPlayer ( ) . getCell ( ) - > cell - > name ! = info . c ell)
if ( MWBase : : Environment : : get ( ) . getWorld ( ) - > getPlayer ( ) . getPlayer ( ) . getCell ( ) - > cell - > mName ! = info . mC ell)
return false ;
return false ;
// TODO check DATAstruct
// TODO check DATAstruct
for ( std : : vector < ESM : : DialInfo : : SelectStruct > : : const_iterator iter ( info . s elects. begin ( ) ) ;
for ( std : : vector < ESM : : DialInfo : : SelectStruct > : : const_iterator iter ( info . mS elects. begin ( ) ) ;
iter ! = info . s elects. end ( ) ; + + iter )
iter ! = info . mS elects. end ( ) ; + + iter )
if ( ! isMatching ( actor , * iter ) )
if ( ! isMatching ( actor , * iter ) )
return false ;
return false ;
@ -646,7 +646,7 @@ namespace MWDialogue
for ( ESMS : : RecListCaseT < ESM : : Dialogue > : : MapType : : iterator it = dialogueList . begin ( ) ; it ! = dialogueList . end ( ) ; it + + )
for ( ESMS : : RecListCaseT < ESM : : Dialogue > : : MapType : : iterator it = dialogueList . begin ( ) ; it ! = dialogueList . end ( ) ; it + + )
{
{
ESM : : Dialogue ndialogue = it - > second ;
ESM : : Dialogue ndialogue = it - > second ;
if ( ndialogue . t ype = = ESM : : Dialogue : : Greeting )
if ( ndialogue . mT ype = = ESM : : Dialogue : : Greeting )
{
{
if ( greetingFound ) break ;
if ( greetingFound ) break ;
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter ( it - > second . mInfo . begin ( ) ) ;
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter ( it - > second . mInfo . begin ( ) ) ;
@ -654,15 +654,15 @@ namespace MWDialogue
{
{
if ( isMatching ( actor , * iter ) & & functionFilter ( mActor , * iter , true ) )
if ( isMatching ( actor , * iter ) & & functionFilter ( mActor , * iter , true ) )
{
{
if ( ! iter - > s ound. empty ( ) )
if ( ! iter - > mS ound. empty ( ) )
{
{
// TODO play sound
// TODO play sound
}
}
std : : string text = iter - > r esponse;
std : : string text = iter - > mR esponse;
parseText ( text ) ;
parseText ( text ) ;
win - > addText ( iter - > r esponse) ;
win - > addText ( iter - > mR esponse) ;
executeScript ( iter - > r esultScript) ;
executeScript ( iter - > mR esultScript) ;
greetingFound = true ;
greetingFound = true ;
mLastTopic = it - > first ;
mLastTopic = it - > first ;
mLastDialogue = * iter ;
mLastDialogue = * iter ;
@ -745,7 +745,7 @@ namespace MWDialogue
for ( ESMS : : RecListCaseT < ESM : : Dialogue > : : MapType : : iterator it = dialogueList . begin ( ) ; it ! = dialogueList . end ( ) ; it + + )
for ( ESMS : : RecListCaseT < ESM : : Dialogue > : : MapType : : iterator it = dialogueList . begin ( ) ; it ! = dialogueList . end ( ) ; it + + )
{
{
ESM : : Dialogue ndialogue = it - > second ;
ESM : : Dialogue ndialogue = it - > second ;
if ( ndialogue . t ype = = ESM : : Dialogue : : Topic )
if ( ndialogue . mT ype = = ESM : : Dialogue : : Topic )
{
{
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter ( it - > second . mInfo . begin ( ) ) ;
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter ( it - > second . mInfo . begin ( ) ) ;
iter ! = it - > second . mInfo . end ( ) ; + + iter )
iter ! = it - > second . mInfo . end ( ) ; + + iter )
@ -813,21 +813,21 @@ namespace MWDialogue
if ( mDialogueMap . find ( keyword ) ! = mDialogueMap . end ( ) )
if ( mDialogueMap . find ( keyword ) ! = mDialogueMap . end ( ) )
{
{
ESM : : Dialogue ndialogue = mDialogueMap [ keyword ] ;
ESM : : Dialogue ndialogue = mDialogueMap [ keyword ] ;
if ( ndialogue . t ype = = ESM : : Dialogue : : Topic )
if ( ndialogue . mT ype = = ESM : : Dialogue : : Topic )
{
{
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter = ndialogue . mInfo . begin ( ) ;
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter = ndialogue . mInfo . begin ( ) ;
iter ! = ndialogue . mInfo . end ( ) ; + + iter )
iter ! = ndialogue . mInfo . end ( ) ; + + iter )
{
{
if ( isMatching ( mActor , * iter ) & & functionFilter ( mActor , * iter , true ) )
if ( isMatching ( mActor , * iter ) & & functionFilter ( mActor , * iter , true ) )
{
{
std : : string text = iter - > r esponse;
std : : string text = iter - > mR esponse;
std : : string script = iter - > r esultScript;
std : : string script = iter - > mR esultScript;
parseText ( text ) ;
parseText ( text ) ;
MWGui : : DialogueWindow * win = MWBase : : Environment : : get ( ) . getWindowManager ( ) - > getDialogueWindow ( ) ;
MWGui : : DialogueWindow * win = MWBase : : Environment : : get ( ) . getWindowManager ( ) - > getDialogueWindow ( ) ;
win - > addTitle ( keyword ) ;
win - > addTitle ( keyword ) ;
win - > addText ( iter - > r esponse) ;
win - > addText ( iter - > mR esponse) ;
executeScript ( script ) ;
executeScript ( script ) ;
@ -858,7 +858,7 @@ namespace MWDialogue
if ( mDialogueMap . find ( mLastTopic ) ! = mDialogueMap . end ( ) )
if ( mDialogueMap . find ( mLastTopic ) ! = mDialogueMap . end ( ) )
{
{
ESM : : Dialogue ndialogue = mDialogueMap [ mLastTopic ] ;
ESM : : Dialogue ndialogue = mDialogueMap [ mLastTopic ] ;
if ( ndialogue . t ype = = ESM : : Dialogue : : Topic )
if ( ndialogue . mT ype = = ESM : : Dialogue : : Topic )
{
{
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter = ndialogue . mInfo . begin ( ) ;
for ( std : : vector < ESM : : DialInfo > : : const_iterator iter = ndialogue . mInfo . begin ( ) ;
iter ! = ndialogue . mInfo . end ( ) ; + + iter )
iter ! = ndialogue . mInfo . end ( ) ; + + iter )
@ -869,10 +869,10 @@ namespace MWDialogue
mChoice = - 1 ;
mChoice = - 1 ;
mIsInChoice = false ;
mIsInChoice = false ;
MWGui : : DialogueWindow * win = MWBase : : Environment : : get ( ) . getWindowManager ( ) - > getDialogueWindow ( ) ;
MWGui : : DialogueWindow * win = MWBase : : Environment : : get ( ) . getWindowManager ( ) - > getDialogueWindow ( ) ;
std : : string text = iter - > r esponse;
std : : string text = iter - > mR esponse;
parseText ( text ) ;
parseText ( text ) ;
win - > addText ( text ) ;
win - > addText ( text ) ;
executeScript ( iter - > r esultScript) ;
executeScript ( iter - > mR esultScript) ;
mLastTopic = mLastTopic ;
mLastTopic = mLastTopic ;
mLastDialogue = * iter ;
mLastDialogue = * iter ;
break ;
break ;