Skip to content

Commit 0dc0ebf

Browse files
committed
Removed unused function CItemMulti::Multi_ListObjs()
1 parent dd71ad7 commit 0dc0ebf

File tree

3 files changed

+11
-76
lines changed

3 files changed

+11
-76
lines changed

src/graysvr/CCharNPCStatus.cpp

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -628,35 +628,21 @@ int CChar::NPC_GetAttackMotivation( CChar * pChar, int iMotivation ) const
628628
// Am I stronger than he is ? Should I continue fighting ?
629629
// Take into consideration AC, health, skills, etc..
630630
// RETURN:
631-
// <-1 = dead meat. (run away)
632-
// 0 = I'm have no interest.
633-
// 50 = even match.
634-
// 100 = he's a push over.
631+
// < 0 = dead meat. (run away)
632+
// 0 = I'm have no interest.
633+
// 50 = even match.
634+
// 100 = he's a push over.
635635

636636
if ( !m_pNPC || !pChar || !pChar->m_pArea )
637637
return 0;
638-
if ( Stat_GetVal(STAT_STR) <= 0 )
639-
return -1; // I'm dead
640-
// Is the target interesting ?
641-
if ( pChar->m_pArea->IsFlag( REGION_FLAG_SAFE )) // universal
638+
if ( IsStatFlag(STATF_DEAD) || pChar->IsStatFlag(STATF_DEAD) )
642639
return 0;
643-
if ( pChar->IsStatFlag(STATF_DEAD) && pChar->m_pNPC && pChar->m_pNPC->m_bonded )
640+
if ( pChar->m_pArea->IsFlag(REGION_FLAG_SAFE) )
644641
return 0;
645-
// If the area is guarded then think better of this.
646-
if ( pChar->m_pArea->IsGuarded() && m_pNPC->m_Brain != NPCBRAIN_GUARD ) // too smart for this.
647-
{
648-
iMotivation -= Stat_GetAdjusted(STAT_INT) / 20;
649-
}
650-
651-
// Owned by or is one of my kind ?
652-
653-
iMotivation += NPC_GetHostilityLevelToward( pChar );
654642

643+
iMotivation += NPC_GetHostilityLevelToward(pChar);
655644
if ( iMotivation > 0 )
656-
{
657-
// Am i injured etc ?
658-
iMotivation = NPC_GetAttackContinueMotivation( pChar, iMotivation );
659-
}
645+
iMotivation = NPC_GetAttackContinueMotivation(pChar, iMotivation); // Am i injured etc ?
646+
660647
return iMotivation;
661648
}
662-

src/graysvr/CItemMulti.cpp

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ void CItemMulti::r_Write( CScript & s )
446446
m_pRegion->r_WriteBody( s, "REGION." );
447447
}
448448
}
449+
449450
bool CItemMulti::r_WriteVal( LPCTSTR pszKey, CGString & sVal, CTextConsole * pSrc )
450451
{
451452
ADDTOCALLSTACK("CItemMulti::r_WriteVal");
@@ -507,60 +508,9 @@ bool CItemMulti::r_LoadVal( CScript & s )
507508
EXC_DEBUG_END;
508509
return false;
509510
}
511+
510512
void CItemMulti::DupeCopy( const CItem * pItem )
511513
{
512514
ADDTOCALLSTACK("CItemMulti::DupeCopy");
513515
CItem::DupeCopy(pItem);
514516
}
515-
516-
517-
size_t CItemMulti::Multi_ListObjs(CObjBase ** ppObjList)
518-
{
519-
ADDTOCALLSTACK("CItemMulti::Multi_ListObjs");
520-
// List all the objects in the structure.
521-
522-
if (!IsTopLevel())
523-
return 0;
524-
525-
int iMaxDist = Multi_GetMaxDist();
526-
527-
// always list myself first. All other items must see my new region !
528-
size_t iCount = 0;
529-
ppObjList[iCount++] = this;
530-
531-
CWorldSearch AreaChar(GetTopPoint(), iMaxDist);
532-
AreaChar.SetAllShow(true);
533-
AreaChar.SetSearchSquare(true);
534-
while (iCount < MAX_MULTI_CONTENT)
535-
{
536-
CChar * pChar = AreaChar.GetChar();
537-
if (pChar == NULL)
538-
break;
539-
if (!m_pRegion->IsInside2d(pChar->GetTopPoint()))
540-
continue;
541-
if (pChar->IsDisconnected() && pChar->m_pNPC)
542-
continue;
543-
544-
ppObjList[iCount++] = pChar;
545-
}
546-
547-
CWorldSearch AreaItem(GetTopPoint(), iMaxDist);
548-
AreaItem.SetSearchSquare(true);
549-
while (iCount < MAX_MULTI_CONTENT)
550-
{
551-
CItem * pItem = AreaItem.GetItem();
552-
if (pItem == NULL)
553-
break;
554-
if (pItem == this) // already listed.
555-
continue;
556-
if (!Multi_IsPartOf(pItem))
557-
{
558-
if (!m_pRegion->IsInside2d(pItem->GetTopPoint()))
559-
continue;
560-
if (!pItem->IsMovable())
561-
continue;
562-
}
563-
ppObjList[iCount++] = pItem;
564-
}
565-
return(iCount);
566-
}

src/graysvr/CObjBase.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,6 @@ class CItemMulti : public CItem
17511751

17521752
public:
17531753
int Multi_GetMaxDist() const;
1754-
size_t Multi_ListObjs(CObjBase ** ppObjList);
17551754
struct ShipSpeed // speed of a ship
17561755
{
17571756
unsigned char period; // time between movement

0 commit comments

Comments
 (0)