mirror of
https://github.com/SphereServer/Source
synced 2026-08-13 10:26:05 -04:00
Removed unused function CItemMulti::Multi_ListObjs()
This commit is contained in:
parent
dd71ad7db3
commit
0dc0ebfaf2
3 changed files with 11 additions and 76 deletions
|
|
@ -628,35 +628,21 @@ int CChar::NPC_GetAttackMotivation( CChar * pChar, int iMotivation ) const
|
|||
// Am I stronger than he is ? Should I continue fighting ?
|
||||
// Take into consideration AC, health, skills, etc..
|
||||
// RETURN:
|
||||
// <-1 = dead meat. (run away)
|
||||
// 0 = I'm have no interest.
|
||||
// 50 = even match.
|
||||
// 100 = he's a push over.
|
||||
// < 0 = dead meat. (run away)
|
||||
// 0 = I'm have no interest.
|
||||
// 50 = even match.
|
||||
// 100 = he's a push over.
|
||||
|
||||
if ( !m_pNPC || !pChar || !pChar->m_pArea )
|
||||
return 0;
|
||||
if ( Stat_GetVal(STAT_STR) <= 0 )
|
||||
return -1; // I'm dead
|
||||
// Is the target interesting ?
|
||||
if ( pChar->m_pArea->IsFlag( REGION_FLAG_SAFE )) // universal
|
||||
if ( IsStatFlag(STATF_DEAD) || pChar->IsStatFlag(STATF_DEAD) )
|
||||
return 0;
|
||||
if ( pChar->IsStatFlag(STATF_DEAD) && pChar->m_pNPC && pChar->m_pNPC->m_bonded )
|
||||
if ( pChar->m_pArea->IsFlag(REGION_FLAG_SAFE) )
|
||||
return 0;
|
||||
// If the area is guarded then think better of this.
|
||||
if ( pChar->m_pArea->IsGuarded() && m_pNPC->m_Brain != NPCBRAIN_GUARD ) // too smart for this.
|
||||
{
|
||||
iMotivation -= Stat_GetAdjusted(STAT_INT) / 20;
|
||||
}
|
||||
|
||||
// Owned by or is one of my kind ?
|
||||
|
||||
iMotivation += NPC_GetHostilityLevelToward( pChar );
|
||||
|
||||
iMotivation += NPC_GetHostilityLevelToward(pChar);
|
||||
if ( iMotivation > 0 )
|
||||
{
|
||||
// Am i injured etc ?
|
||||
iMotivation = NPC_GetAttackContinueMotivation( pChar, iMotivation );
|
||||
}
|
||||
iMotivation = NPC_GetAttackContinueMotivation(pChar, iMotivation); // Am i injured etc ?
|
||||
|
||||
return iMotivation;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -446,6 +446,7 @@ void CItemMulti::r_Write( CScript & s )
|
|||
m_pRegion->r_WriteBody( s, "REGION." );
|
||||
}
|
||||
}
|
||||
|
||||
bool CItemMulti::r_WriteVal( LPCTSTR pszKey, CGString & sVal, CTextConsole * pSrc )
|
||||
{
|
||||
ADDTOCALLSTACK("CItemMulti::r_WriteVal");
|
||||
|
|
@ -507,60 +508,9 @@ bool CItemMulti::r_LoadVal( CScript & s )
|
|||
EXC_DEBUG_END;
|
||||
return false;
|
||||
}
|
||||
|
||||
void CItemMulti::DupeCopy( const CItem * pItem )
|
||||
{
|
||||
ADDTOCALLSTACK("CItemMulti::DupeCopy");
|
||||
CItem::DupeCopy(pItem);
|
||||
}
|
||||
|
||||
|
||||
size_t CItemMulti::Multi_ListObjs(CObjBase ** ppObjList)
|
||||
{
|
||||
ADDTOCALLSTACK("CItemMulti::Multi_ListObjs");
|
||||
// List all the objects in the structure.
|
||||
|
||||
if (!IsTopLevel())
|
||||
return 0;
|
||||
|
||||
int iMaxDist = Multi_GetMaxDist();
|
||||
|
||||
// always list myself first. All other items must see my new region !
|
||||
size_t iCount = 0;
|
||||
ppObjList[iCount++] = this;
|
||||
|
||||
CWorldSearch AreaChar(GetTopPoint(), iMaxDist);
|
||||
AreaChar.SetAllShow(true);
|
||||
AreaChar.SetSearchSquare(true);
|
||||
while (iCount < MAX_MULTI_CONTENT)
|
||||
{
|
||||
CChar * pChar = AreaChar.GetChar();
|
||||
if (pChar == NULL)
|
||||
break;
|
||||
if (!m_pRegion->IsInside2d(pChar->GetTopPoint()))
|
||||
continue;
|
||||
if (pChar->IsDisconnected() && pChar->m_pNPC)
|
||||
continue;
|
||||
|
||||
ppObjList[iCount++] = pChar;
|
||||
}
|
||||
|
||||
CWorldSearch AreaItem(GetTopPoint(), iMaxDist);
|
||||
AreaItem.SetSearchSquare(true);
|
||||
while (iCount < MAX_MULTI_CONTENT)
|
||||
{
|
||||
CItem * pItem = AreaItem.GetItem();
|
||||
if (pItem == NULL)
|
||||
break;
|
||||
if (pItem == this) // already listed.
|
||||
continue;
|
||||
if (!Multi_IsPartOf(pItem))
|
||||
{
|
||||
if (!m_pRegion->IsInside2d(pItem->GetTopPoint()))
|
||||
continue;
|
||||
if (!pItem->IsMovable())
|
||||
continue;
|
||||
}
|
||||
ppObjList[iCount++] = pItem;
|
||||
}
|
||||
return(iCount);
|
||||
}
|
||||
|
|
@ -1751,7 +1751,6 @@ protected:
|
|||
|
||||
public:
|
||||
int Multi_GetMaxDist() const;
|
||||
size_t Multi_ListObjs(CObjBase ** ppObjList);
|
||||
struct ShipSpeed // speed of a ship
|
||||
{
|
||||
unsigned char period; // time between movement
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue