1
This commit is contained in:
parent
73490d8119
commit
b52a2f4778
@ -177,6 +177,7 @@ bool Buff::FreezeOperate()
|
||||
|
||||
void Buff::ProcBecome(Creature* caster)
|
||||
{
|
||||
hold_curr_weapon_idx_ = caster->GetCurrWeapon()->weapon_idx;
|
||||
if (caster->IsHuman() && meta->param2 > 0.01) {
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(meta->i->buff_param2(), strings, ':');
|
||||
@ -216,6 +217,7 @@ void Buff::ProcRemoveBecome(Creature* caster)
|
||||
|
||||
void Buff::ProcDriver(Creature* caster)
|
||||
{
|
||||
hold_curr_weapon_idx_ = caster->GetCurrWeapon()->weapon_idx;
|
||||
if (caster->IsHuman()) {
|
||||
Human* hum = (Human*)caster;
|
||||
if (hum->GetCar() && hum->GetCar()->GetCurrWeapon()) {
|
||||
@ -244,10 +246,17 @@ void Buff::RecoverHoldWeapons(Creature* caster)
|
||||
caster->weapons[weapon.weapon_idx] = weapon;
|
||||
}
|
||||
}
|
||||
if (!hold_weapons_.empty()) {
|
||||
Weapon* next_weapon = caster->AutoChgWeapon();
|
||||
if (next_weapon) {
|
||||
caster->SetCurrWeapon(next_weapon);
|
||||
if (hold_curr_weapon_idx_ >=0 &&
|
||||
hold_curr_weapon_idx_ <= caster->weapons.size() &&
|
||||
caster->weapons[hold_curr_weapon_idx_].weapon_id != 0) {
|
||||
Weapon* next_weapon = &caster->weapons[hold_curr_weapon_idx_];
|
||||
caster->SetCurrWeapon(next_weapon);
|
||||
} else {
|
||||
if (!hold_weapons_.empty()) {
|
||||
Weapon* next_weapon = caster->AutoChgWeapon();
|
||||
if (next_weapon) {
|
||||
caster->SetCurrWeapon(next_weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
hold_weapons_.clear();
|
||||
|
@ -49,5 +49,6 @@ private:
|
||||
void RecoverHoldWeapons(Creature* caster);
|
||||
|
||||
private:
|
||||
int hold_curr_weapon_idx_ = 0;
|
||||
std::list<Weapon> hold_weapons_;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user