evennia / ainneve

A full example game created in Evennia (under development, anyone can help!)
77 stars 52 forks source link

Characters can Attack Themselves #102

Closed aliceafterall closed 7 years ago

aliceafterall commented 7 years ago

We're not checking that the target is not the same as the attacker - therefore one can enter combat with themselves.

Steps to Reproduce:

  1. type "attack self"
  2. Declare action - for instance, "kick self"

Expected/Actual I would expect a message of the sort "You can't attack yourself", but instead I'm able to enter combat with myself and I get stuck there. I also get a "stopiteration" traceback:

Traceback (most recent call last):
  File "/home/user/Projects/ainneve/evennia/evennia/commands/cmdhandler.py", line 591, in _run_command
    ret = cmd.func()
  File "./commands/combat.py", line 798, in func
    opponents_by_range = ch.get_proximity(caller)
  File "./typeclasses/combat_handler.py", line 260, in get_proximity
    if character.id in k]:
StopIteration
aliceafterall commented 7 years ago

106 fixes. Thanks, @dgisser!