This commit is contained in:
aozhiwei 2021-04-28 15:25:31 +08:00
parent 0d1b25df6b
commit d8fe3ecd20

View File

@ -210,18 +210,18 @@ void Buff::ProcBecome(Creature* caster)
void Buff::ProcRemoveBecome(Creature* caster)
{
if (!hold_weapons_.empty()) {
Weapon* next_weapon = caster->AutoChgWeapon();
if (next_weapon) {
caster->SetCurrWeapon(next_weapon);
}
}
for (auto& weapon : hold_weapons_) {
if (weapon.weapon_idx >= 0 &&
weapon.weapon_idx < caster->weapons.size()) {
caster->weapons[weapon.weapon_idx] = weapon;
}
}
if (!hold_weapons_.empty()) {
Weapon* next_weapon = caster->AutoChgWeapon();
if (next_weapon) {
caster->SetCurrWeapon(next_weapon);
}
}
hold_weapons_.clear();
caster->need_sync_active_player = true;
caster->SyncAroundPlayers(__FILE__, __LINE__, __func__);