1
This commit is contained in:
parent
c91d2ea249
commit
fe5244c52d
@ -3841,7 +3841,9 @@ void Creature::Throw(int throw_uniid, int slot,
|
||||
0,
|
||||
1,
|
||||
nullptr);
|
||||
//pending_throw_bomb[throw_uniid] = throw_bomb;
|
||||
if (IsPlayer()) {
|
||||
AsPlayer()->pending_throw_bomb[throw_uniid] = AsPlayer()->throw_bomb;
|
||||
}
|
||||
room->xtimer.SetTimeoutEx
|
||||
(
|
||||
SERVER_FRAME_RATE * 15,
|
||||
|
@ -1725,29 +1725,6 @@ void Player::UpdateThrowBomb()
|
||||
if (weapon.weapon_idx != 0 &&
|
||||
weapon.meta &&
|
||||
weapon.ammo > 0) {
|
||||
if (HasBuffEffect(kBET_Hide)) {
|
||||
RemoveHideEffect(kShotReason);
|
||||
}
|
||||
if (!nature_recover_hp_idle_timer.expired()) {
|
||||
room->xtimer.FireEvent
|
||||
(
|
||||
nature_recover_hp_idle_timer,
|
||||
kRemoveNatureRecoverTimerEvent,
|
||||
nullptr);
|
||||
}
|
||||
--weapon.ammo;
|
||||
room->frame_event.AddPropChgEx
|
||||
(
|
||||
GetWeakPtrRef(),
|
||||
kPropWeaponAmmo,
|
||||
weapon.weapon_idx,
|
||||
weapon.ammo,
|
||||
weapon.GetClipVolume(this),
|
||||
0,
|
||||
true
|
||||
);
|
||||
DecInventory(equip_meta->_inventory_slot(), 1);
|
||||
SyncVolume(equip_meta->_inventory_slot());
|
||||
glm::vec3 bomb_pos = glm::vec3(
|
||||
throw_bomb->pos().x(),
|
||||
throw_bomb->pos().y(),
|
||||
@ -1758,31 +1735,12 @@ void Player::UpdateThrowBomb()
|
||||
throw_bomb->dir().y(),
|
||||
throw_bomb->dir().z()
|
||||
);
|
||||
SetAttackDir(bomb_dir);
|
||||
int throw_uniid = room->AllocUniid();
|
||||
room->frame_event.AddBullet
|
||||
(
|
||||
throw_uniid,
|
||||
GetWeakPtrRef(),
|
||||
equip_meta,
|
||||
1,
|
||||
Throw(0,
|
||||
slot_id,
|
||||
bomb_pos,
|
||||
bomb_dir,
|
||||
throw_bomb->fly_distance(),
|
||||
0,
|
||||
1,
|
||||
nullptr);
|
||||
pending_throw_bomb[throw_uniid] = throw_bomb;
|
||||
room->xtimer.SetTimeoutEx
|
||||
(
|
||||
SERVER_FRAME_RATE * 15,
|
||||
[this, throw_uniid] (int event, const a8::Args* args)
|
||||
{
|
||||
if (a8::TIMER_DELETE_EVENT == event) {
|
||||
ProcThrowDmg(throw_uniid);
|
||||
}
|
||||
},
|
||||
&room->xtimer_attacher_);
|
||||
0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user