mob
verb
Race()
for(var/mob/M in world)
if(!M.key) continue //skip NPCs
if(M.racing == 1) continue
var/race = input("Race who?") in list(M.name)
if(race == M.name)
switch(input(M,"[src] wants to race you. Accept?","Challenge!") in list("Yes","No"))
if("Yes")
world << "<b>[src.name] is now racing [M.name]!"
src.StartRace(M)
else
src << "[M] declined."
return
proc
StartRace(mob/M,mob/C)
C.distance = 0
M.distance = 0
sleep(5)
//And so on...
runtime error: Cannot modify null.distance.
proc name: StartRace (/mob/proc/StartRace)
usr: the haha (/mob)
src: the haha (/mob)
call stack:
the haha (/mob): StartRace(the haha (/mob), null)
the haha (/mob): Race()
Problem description: "The Haha" is just a test name for me :P. I'm currently racing myself, but I can't because of this. If I can't start races, then the whole game has collapsed in one.
Also, if(var==1) should be if(var).