1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-10 04:37:45 +00:00

fix some PlayerCondition flags

This commit is contained in:
collett 2023-04-30 19:36:24 +09:00
parent e7cfe87fef
commit 78b860d9f8
2 changed files with 8 additions and 3 deletions

View file

@ -1373,9 +1373,10 @@ namespace Sapphire::Common
{
None1 = 0,
HideUILockChar = 1, // as the name suggests, hides the ui and logs the char...
InCombat = 2, // in Combat, locks gearchange/return/teleport
Casting = 3,
InNpcEvent = 6, // when talking to an npc, locks ui giving "occupied" message
InCombat = 18, // in Combat, locks gearchange/return/teleport
Casting = 19,
EventAction = 22,
InNpcEvent = 24, // when talking to an npc, locks ui giving "occupied" message
// InNpcEvent1 = 10, // Sent together with InNpcEvent, when waiting for input? just a guess...

View file

@ -1134,6 +1134,7 @@ const std::map< uint32_t, uint8_t >& Player::getActorIdToHateSlotMap()
void Player::onMobAggro( const BNpc& bnpc )
{
hateListAdd( bnpc );
setCondition( PlayerCondition::InCombat );
Network::Util::Packet::sendActorControl( *this, getId(), SetBattle, 1 );
}
@ -1141,7 +1142,10 @@ void Player::onMobDeaggro( const BNpc& bnpc )
{
hateListRemove( bnpc );
if( m_actorIdTohateSlotMap.empty() )
{
removeCondition( PlayerCondition::InCombat );
Network::Util::Packet::sendActorControl( *this, getId(), SetBattle, 0 );
}
}
bool Player::isLogin() const