mob/verb/attack(mob/M as mob in oview(usr)) //Attack verb
set hidden=1
if(M && M!=usr)
if(usr.fighting)
return
if(M.type!=/mob/player && M.ai==0)
usr<<"[M]: [M.turndown]"
return
else
if(M.fighting==0)
M.move=0
usr.move=0//Make sure they cant move
M.hadturn=0
usr.hadturn=0//Make sure they get their turn
M.Turn()
M.opponents.Add(usr)
//---^ This is the problem!//
//Just the beginning snippet//
Now it seems allright, im trying to add usr to the other mob's opponent's list which is defined as
mob/var/opponents[]=new/list()
Now here is the error I get
runtime error: Cannot execute null.Add().
proc name: attack (/mob/verb/attack)
source file: macro verbs.dm,78
usr: NeoHaxor (/mob/player)
src: NeoHaxor (/mob/player)
call stack:
NeoHaxor (/mob/player): attack(Dragonball Character (/mob/characters/AI/dragonball))
Which is basically saying it either cant read the Mob or the list variable that accompanies it, and It seems that I have tried everything. Any suggestions?
--Ken--
Do you need the [] after opponents? I thought that [] were for declaring arrays (at least in java), but not for lists.