runtime error: Cannot read null.len
proc name: SummonSlime1 (/mob/monster/SummonSlime1)
source file: MonsterSpells.dm,276
usr: Test Metroid (/mob/Newchar)
src: Healer-B (/mob/monster/Area2/Healer)
call stack:
Healer-B (/mob/monster/Area2/Healer): SummonSlime1(Test Metroid (/mob/Newchar), null)
Healer-B (/mob/monster/Area2/Healer): Spell(Test Metroid (/mob/Newchar), null)
Healer-B (/mob/monster/Area2/Healer): Battle(Test Metroid (/mob/Newchar), null)
Test Metroid (/mob/Newchar): MasterBattle(Healer (/mob/monster/Area2/Healer), null)
Test Metroid (/mob/Newchar): MasterBattle(Healer (/mob/monster/Area2/Healer), null)
I've been tring for the last hour to get this fixed but theres nothing that will work, now here's my code for SummonSlime1
SummonSlime1(mob/Newchar/P,mob/monster/list/enemylist)
var
chance = rand(0,2)
P << "The [src] chants!"
P << 'spell.wav'
sleep(10)
if(chance == 1)
if(enemylist.len>=12) // Line 276
P << "Nothing seemed to happen."
return
else
P << "A Slime appeared!"
var/mob/monster/Summoned/SummonedSlime1/new_mob=new
var/list/letters=list("-A","-B","-C","-D","-E","-F","-G","-H","-I","-J","-K","-L")
var/letter=1
for(var/mob/M in enemylist)
if(M.type==new_mob.type)letter+=1
new_mob.name+=letters[letter]
enemylist+=new_mob
else
P << "Nothing seemed to happen."
sleep(10)
I have marked where Line 276 is because according to the runtime, thats where the problem is. The mob/monster/list/enemylist is the original list from when battle was triggered. I transfered it all the way to this proc. Someone please help, I really need this to work!
First off with the mob/monster/list/enemylist part I don't think you need the mob/monster/ part since you can define what type of things a list will hold.
If enemylist is null then you probably either passed in something null as the parameter to this function or nothing at all.