ID:2413359
 
(See the best response by NSBR.)
Code:
Bump(mob/M) 
if(istype(M,/mob/characters))
Attack(M) //Attack it with a proc that is defined elsewhere.

proc
Attack(mob/characters/M)
if (!M) return
var/damage = powerlevel
M.TakeDamage(src, damage)
TakeDamage(mob/attacker, damage)
if (istype(src, /mob/other))
usr << "<font color=red>No..."
else
if(src.npp == 0|1)
var/dmg = round(attacker.maxpowerlevel / rand(40,85))
src.powerlevel -= dmg
src.Die()
attacker.powerlevel += rand(0,1)
attacker.random = rand(1,3)
if(src.powerlevel >= 1)
if(attacker.random == 1)
view(6) << "<font color = blue><b>[attacker.name] punches [src] for [dmg] ."
if(attacker.random == 2)
view(6) << "<font color = blue><b>[attacker.name] kicks [src] for [dmg]."
if(attacker.random == 3)
view(6) << "<font color = blue><b>[attacker.name] stumbles and misses [src]."


Problem description:
I posted the bump() and the attack proc it activates. They both are working perfectly fine except if 2 mobs are in the same tile. For instant I fly and land on top of a mob, the surrounding mobs can't attack me, I believe they are only bumping the mob below, any help appreciated

Any help, not even looking for someone to show me the fixed code, just to be steered in the right direction, I couldn't find any information about this in the forum
Best response
Don't land on top of the mob. It's bad practice.

If you want an workaround you could make
Bump(mob/M)
for(var/mob/characters/Z in M.loc)
Attack(Z)
Thank you this worked like a charm, I needed it to prevent bug abuse, like someone landing on a dense turf and training on the mobs from there
In response to Vegetto7
No problem. I'd still recommend that you don't allow mobs to be on top of each other, otherwise you'd have to make this workaround on all Bumps, including projectiles etc. If you could mark my previous response as best response, I'd appreciate it.