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 itemInfo = exdData->get< Core::Data::Item >( pItem->getId() );
|
||||||
auto itemClassJob = itemInfo->classJobUse;
|
auto itemClassJob = itemInfo->classJobUse;
|
||||||
|
auto classJobInfo = exdData->get< Core::Data::ClassJob >( (uint32_t)getClass() );
|
||||||
auto currentClass = getClass();
|
auto currentParentClass = static_cast< ClassJob >(classJobInfo->classJobParent);
|
||||||
auto newClassJob = static_cast< ClassJob >( itemClassJob );
|
auto newClassJob = static_cast< ClassJob >( itemClassJob );
|
||||||
|
|
||||||
if( isClassJobUnlocked( newClassJob ) )
|
if( ( isClassJobUnlocked( newClassJob ) ) && ( currentParentClass != newClassJob ) )
|
||||||
return;
|
setClassJob( newClassJob );
|
||||||
|
|
||||||
// todo: check if soul crystal is equipped and use job instead
|
|
||||||
|
|
||||||
setClassJob( newClassJob );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// equip an item
|
// equip an item
|
||||||
|
@ -160,8 +156,7 @@ void Core::Entity::Player::updateModels( GearSetSlot equipSlotId, const Core::It
|
||||||
case MainHand:
|
case MainHand:
|
||||||
m_modelMainWeapon = model;
|
m_modelMainWeapon = model;
|
||||||
m_modelSubWeapon = model2;
|
m_modelSubWeapon = model2;
|
||||||
// TODO: add job change upon changing weapon if needed
|
equipWeapon( pItem );
|
||||||
// equipWeapon( pItem );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OffHand:
|
case OffHand:
|
||||||
|
|
Loading…
Add table
Reference in a new issue