no_projectile for Tools that have no projectile; condensing cases in WSA

This commit is contained in:
FateJH 2019-11-15 16:21:35 -05:00
parent ed7406f25f
commit f8836f1cc4
3 changed files with 14 additions and 7 deletions

View file

@ -4325,17 +4325,14 @@ class WorldSessionActor extends Actor with MDCContextAware {
log.trace("ChangeFireState_Start: " + msg)
if(shooting.isEmpty) {
FindEquipment match {
//special case - suppress the decimator's alternate fire mode
case Some(tool : Tool)
if tool.Projectile == GlobalDefinitions.phoenix_missile_guided_projectile &&
(tool.Magazine > 0 || prefire.contains(item_guid)) =>
prefire = None
shooting = Some(item_guid)
case Some(tool : Tool) =>
if(tool.Magazine > 0 || prefire.contains(item_guid)) {
prefire = None
shooting = Some(item_guid)
avatarService ! AvatarServiceMessage(continent.Id, AvatarAction.ChangeFireState_Start(player.GUID, item_guid))
//special case - suppress the decimator's alternate fire mode, by projectile
if(tool.Projectile != GlobalDefinitions.phoenix_missile_guided_projectile) {
avatarService ! AvatarServiceMessage(continent.Id, AvatarAction.ChangeFireState_Start(player.GUID, item_guid))
}
}
else {
log.warn(s"ChangeFireState_Start: ${tool.Definition.Name} magazine is empty before trying to shoot bullet")