ID:138793
 
Code:
mob/Bump(mob/M as mob in oview(1))
if(M != src)
var/damage= M.str - src.def
if(damage <= 0)
src<<"You bumped into [M] but took no damage!"
step_away(src,M,600,10)
else
src<<"You bumped into [M] causing [damage] damage!"
src.hp-=damage
step_away(src,M,600,10)


When running the game, i get the "You bumped into [M] causing [damage] damage!" message twice. Why would that happen? In these early stages, it's not that big of a problem, but in the long run it means it will take double the damage, and i don't want that.

Most likely because you are using mob/M as mob in oview(1). That kind of stuff is only needed in verbs, if that. Just do:

mob/Bump(atom/a)
if(ismob(a))
var/mob/m = a
// Do all your other stuff now
In response to Albro1
I now have this:

Bump(atom/a)
if(ismob(a))
var/mob/M = a
if(M!= src)
var/damage= M.str - src.def
if(damage <= 0)
src<<"You bumped into [M] but took no damage!"
step_away(src,M,600,10)
src.cant_move=1
sleep(2)
src.cant_move=0
else
src<<"You bumped into [M] causing [damage] damage!"
src.hp-=damage
step_away(src,M,600,10)
src.cant_move=1
sleep(2)
src.cant_move=0


I still get two messages for each Bump(). Did i miss something?