ID:142148
 
Code:
mob/PC/verb/Finish(mob/M in get_step(usr,usr.dir))
set category = "Combat"

usr.afk_time = 0

if(!M)
return

if(M.safe == 1)
src << "<font color = gray>A force stops you from attacking [M]!"
return

if(src.type == /mob/PC)
if(M.KO == 1)
M.DEATH()
return
else
src << "<font color = gray>They are not knocked out yet!"
return
else
if(M.KO == 1)
M.DEATH()
return
else
src << "<font color = gray>They are not knocked out yet!"
return


Problem description:
ok i keep getting this eror on the options and message screen:5
runtime error: Cannot execute null.New().
proc name: CreateName (/mob/proc/CreateName)
source file: Finish.dm

can somebody tell me why? thanks!

Like the error says, the problem isn't in your Finish() verb (which could still use some tweaking, most notably using normal/'boolean' checks instead of ==), but in the /mob/proc/CreateName procedure, so we need to see it to figure out why it's happening. Typically this error means you are trying to call a proc on a variable which's value is null because the object that it used to reference was deleted, though I don't see why you'd call New() manually, and if you did then it should be changed since it shouldn't really be done.
In response to Kaioken
Kaioken wrote:
Like the error says, the problem isn't in your Finish() verb (which could still use some tweaking, most notably using normal/'boolean' checks instead of ==), but in the /mob/proc/CreateName procedure, so we need to see it to figure out why it's happening. Typically this error means you are trying to call a proc on a variable which's value is null because the object that it used to reference was deleted, though I don't see why you'd call New() manually, and if you did then it should be changed since it shouldn't really be done.

.what do you mean by normal/'boolean' checks
In response to Kole92
It means, don't check for specific values with the == operator, simply put the value directly in the if() statement alone, as the purpose of if() itself is to check for true values, nothing extra is needed. Read more here: http://www.byond.com/members/ DreamMakers?command=view_post&post=39699

Also, you should pay attention to the whole replies you're given, not only a few words. As it is, you cannot be helped.