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:
parent
a7fc43a2d5
commit
30c80450e2
1 changed files with 5 additions and 10 deletions
|
@ -122,16 +122,12 @@ 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
|
||||
|
||||
setClassJob( newClassJob );
|
||||
if( ( isClassJobUnlocked( newClassJob ) ) && ( currentParentClass != newClassJob ) )
|
||||
setClassJob( newClassJob );
|
||||
}
|
||||
|
||||
// equip an item
|
||||
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue