|
From: <kw...@us...> - 2002-10-27 00:24:08
|
Update of /cvsroot/decaldev/source/DecalFilters
In directory usw-pr-cvs1:/tmp/cvs-serv17393
Modified Files:
CharacterStats.cpp
Log Message:
changed how allegiance conditions are checked
-special cases:
if (Monarch.GUID == character) PlayerIsMonarch;
if (Monarch.GUID == MyAllegiance.TreeParent) MonarchIsPatron;
changed a bunch of return codes
Index: CharacterStats.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DecalFilters/CharacterStats.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** CharacterStats.cpp 26 Oct 2002 08:13:58 -0000 1.33
--- CharacterStats.cpp 27 Oct 2002 00:23:57 -0000 1.34
***************
*** 638,655 ****
strcpy(tpai.Name, OLE2T(vName.bstrVal));
! if (tpai.GUID == GUID)
{
- //Me
- memcpy(&MyAlleg, &tpai, sizeof(cAllegianceInfo));
- } else if (tpai.TreeParent == 1) {
//Monarch
memcpy(&Monarch, &tpai, sizeof(cAllegianceInfo));
! } else if (tpai.TreeParent == GUID) {
//Vassal
memcpy(&Vassals[VassalCount], &tpai, sizeof(cAllegianceInfo));
VassalCount++;
- } else {
- //Patron
- memcpy(&Patron, &tpai, sizeof(cAllegianceInfo));
}
}
--- 638,656 ----
strcpy(tpai.Name, OLE2T(vName.bstrVal));
! if (tpai.TreeParent == 1)
{
//Monarch
memcpy(&Monarch, &tpai, sizeof(cAllegianceInfo));
! } else if (tpai.GUID == GUID) {
! //Me
! memcpy(&MyAlleg, &tpai, sizeof(cAllegianceInfo));
! } else if (tpai.TreeParent != GUID) {
! //Patron
! memcpy(&Patron, &tpai, sizeof(cAllegianceInfo));
! } else if (tpai.TreeParent == GUID)
! {
//Vassal
memcpy(&Vassals[VassalCount], &tpai, sizeof(cAllegianceInfo));
VassalCount++;
}
}
***************
*** 1026,1030 ****
{
*pVal = -1;
! return S_FALSE;
}
--- 1027,1031 ----
{
*pVal = -1;
! return E_FAIL;
}
***************
*** 1160,1164 ****
if ((Index < 1) || (Index > 3))
! return S_FALSE;
CComObject< ::cSkillInfo > *pSkill;
--- 1161,1165 ----
if ((Index < 1) || (Index > 3))
! return E_FAIL;
CComObject< ::cSkillInfo > *pSkill;
***************
*** 1203,1207 ****
if ((Index < 1) || (Index > 39))
! return S_FALSE;
--- 1204,1208 ----
if ((Index < 1) || (Index > 39))
! return E_FAIL;
***************
*** 1230,1234 ****
if ((Index < 1) || (Index > 6))
! return S_FALSE;
CComObject< ::cAttributeInfo > *pAttrib;
--- 1231,1235 ----
if ((Index < 1) || (Index > 6))
! return E_FAIL;
CComObject< ::cAttributeInfo > *pAttrib;
***************
*** 1288,1292 ****
if (!Monarch.GUID)
! return S_FALSE;
CComObject< ::cAllegianceInfo > *pAlleg;
--- 1289,1293 ----
if (!Monarch.GUID)
! return E_FAIL;
CComObject< ::cAllegianceInfo > *pAlleg;
***************
*** 1366,1370 ****
if ((VassalNum < 0) || (VassalNum >= VassalCount))
! return S_FALSE;
if (!Vassals[ VassalNum ].GUID)
--- 1367,1371 ----
if ((VassalNum < 0) || (VassalNum >= VassalCount))
! return E_FAIL;
if (!Vassals[ VassalNum ].GUID)
***************
*** 1422,1426 ****
if ((Index < 1) || (Index > 3))
! return S_FALSE;
float fSkill = SecStatInc[Index - 1];
--- 1423,1427 ----
if ((Index < 1) || (Index > 3))
! return E_FAIL;
float fSkill = SecStatInc[Index - 1];
***************
*** 1442,1446 ****
if ((Index < 1) || (Index > 39))
! return S_FALSE;
// get current skill
--- 1443,1447 ----
if ((Index < 1) || (Index > 39))
! return E_FAIL;
// get current skill
***************
*** 1469,1473 ****
if ((Index < 1) || (Index > 6))
! return S_FALSE;
*pVal = CurStat[Index - 1];
--- 1470,1474 ----
if ((Index < 1) || (Index > 6))
! return E_FAIL;
*pVal = CurStat[Index - 1];
***************
*** 1518,1522 ****
if (EnchantNum < 0)
! return S_FALSE;
std::list<cEnchantment *>::iterator tpi = Enchantments.begin();
--- 1519,1523 ----
if (EnchantNum < 0)
! return E_FAIL;
std::list<cEnchantment *>::iterator tpi = Enchantments.begin();
|