1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Implements class change on weapon swap.

This commit is contained in:
Squall Leonhart 2018-10-17 23:25:41 +03:00
parent a7fc43a2d5
commit 30c80450e2

View file

@ -122,15 +122,11 @@ void Core::Entity::Player::equipWeapon( ItemPtr pItem )
auto itemInfo = exdData->get< Core::Data::Item >( pItem->getId() );
auto itemClassJob = itemInfo->classJobUse;
auto currentClass = getClass();
auto classJobInfo = exdData->get< Core::Data::ClassJob >( (uint32_t)getClass() );
auto currentParentClass = static_cast< ClassJob >(classJobInfo->classJobParent);
auto newClassJob = static_cast< ClassJob >( itemClassJob );
if( isClassJobUnlocked( newClassJob ) )
return;
// todo: check if soul crystal is equipped and use job instead
if( ( isClassJobUnlocked( newClassJob ) ) && ( currentParentClass != newClassJob ) )
setClassJob( newClassJob );
}
@ -160,8 +156,7 @@ void Core::Entity::Player::updateModels( GearSetSlot equipSlotId, const Core::It
case MainHand:
m_modelMainWeapon = model;
m_modelSubWeapon = model2;
// TODO: add job change upon changing weapon if needed
// equipWeapon( pItem );
equipWeapon( pItem );
break;
case OffHand: