1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-03 09:17:47 +00:00

fix self targeted actions failing target snapshot, fix player being unable to complete chasing shadows

This commit is contained in:
NotAdam 2019-05-28 22:03:55 +10:00
parent 1a5ab3ec10
commit 1cab7afe0e
3 changed files with 11 additions and 13 deletions

View file

@ -67,6 +67,13 @@ public:
return;
}
if( instance.getCountEnemyBNpc() == 0 && successCalled == 0 )
{
instance.setCustomVar( SUCCESS_CALLED, 1 );
instance.success();
return;
}
if( !boss || !ida || !papa )
return;
@ -141,14 +148,6 @@ public:
a4->hateListAdd( pPlayer, 1 );
a5->hateListAdd( pPlayer, 1 );
}
if( instance.getCountEnemyBNpc() == 0 && successCalled == 0 )
{
instance.setCustomVar( SUCCESS_CALLED, 1 );
instance.success();
return;
}
}
void onEnterTerritory( QuestBattle& instance, Entity::Player& player, uint32_t eventId, uint16_t param1,

View file

@ -491,7 +491,7 @@ bool Sapphire::Action::Action::consumeResources()
bool Sapphire::Action::Action::snapshotAffectedActors( std::vector< Entity::CharaPtr >& actors )
{
for( const auto& actor : m_pSource->getInRangeActors() )
for( const auto& actor : m_pSource->getInRangeActors( true ) )
{
// check for initial target validity based on flags in action exd (pc/enemy/etc.)
if( !preFilterActor( *actor ) )
@ -515,9 +515,8 @@ bool Sapphire::Action::Action::snapshotAffectedActors( std::vector< Entity::Char
player->sendDebug( "hit actor#{}", actor->getId() );
}
}
if( actors.empty() )
return false;
return true;
return !actors.empty();
}
void Sapphire::Action::Action::addActorFilter( World::Util::ActorFilterPtr filter )

View file

@ -385,7 +385,7 @@ uint32_t Sapphire::QuestBattle::getQuestId() const
uint32_t Sapphire::QuestBattle::getCountEnemyBNpc()
{
uint32_t count = 0;
for( auto bnpcIt : m_bNpcMap )
for( const auto& bnpcIt : m_bNpcMap )
{
if( bnpcIt.second->getEnemyType() == 4 && bnpcIt.second->isAlive() )
count++;