Tomm0017 / rsmod

New repository: https://github.com/rsmod/rsmod
https://github.com/rsmod/rsmod
Apache License 2.0
125 stars 101 forks source link

Multiple NPCs can attack in single combat #160

Open JeztC opened 5 years ago

JeztC commented 5 years ago

Current Behavior

Multiple NPCs can attack player even if not in multi-combat zone. Player can also attack multiple npcs at the same time.

Expected Behavior

Player/NPC should only be able to attack a single target in non-multi combat zone.

Steps to Reproduce the Problem

  1. Go to Edgeville
  2. Attack multiple npcs at the same time.
dosier commented 5 years ago

I believe this cannot be fixed (elegantly) at the moment. The npc option packet handler directly calls the pawn.attack method. The pawn.attack method then overrides the pawn's combat target before activating the combat plugin (prior to it hitting any combat conditions.) Therefore from within the combat plugin, there is no direct way of knowing whether the pawn initiating the attack is already under attack or not.

JeztC commented 5 years ago

I believe this cannot be fixed (elegantly) at the moment. The npc option packet handler directly calls the pawn.attack method. The pawn.attack method then overrides the pawn's combat target before activating the combat plugin (prior to it hitting any combat conditions.) Therefore from within the combat plugin, there is no direct way of knowing whether the pawn initiating the attack is already under attack or not.

Oh. Do u know if it'll be fixed soon?