turf
icon = 'Environment.dmi'
Entered(atom/O)
var/area/AREA = src.loc
if(ismob(O))
var/mob/Player = O
if(Player.client)
var/SpawnChance = rand(0, 100)
if(SpawnChance < AREA.SpawnPercent)
var/Monster/ToSpawn = pick(AREA.MonsterList)
/* Instead of spawning the actual instance (depleting the list), spawn a copy of the monster in the list. */
var/Monster/Spawn = new ToSpawn.type
var/turf/SpawnLoc = pick(view(O))
var/area/SpawnArea = null
Spawn.Move(SpawnLoc)
if(Spawn.loc == null)
del Spawn
else
SpawnArea = SpawnLoc.loc
if(!isnull(SpawnArea) && SpawnArea.Safe) del Spawn //Error line
for(var/Monster/Sleeping in view(src, 20))
if(Sleeping.Idle || get_dist(src, Sleeping) > Sleeping.Attack_Range) continue
Sleeping.AI()
else ..()
else ..()
Problem description:
There's a lot here. Apparently I'm trying to access a variable on the mob /mob/var/Safe. HOWEVER. I see no place where that mixup may have occurred. Any ideas? The only thing I could imagine was an error in the Move() proc, but that's
mob
Move()
src.Moving = 1
..()
src.Moving = 0 // Pretty sure this line isn't reached but whatever.
Error:
runtime error: undefined variable /mob/var/Safe
proc name: Entered (/turf/Entered)
source file: Environment.dm,44
usr: Lugia319 (/mob)
src: Grass (12,17,1) (/turf/Grass)
call stack:
Grass (12,17,1) (/turf/Grass): Entered(Lugia319 (/mob), Grass (11,17,1) (/turf/Grass))
Lugia319 (/mob): Move(Grass (11,17,1) (/turf/Grass), 4, 12, 10)
Lugia319 (/mob): DetectStep(4)
Lugia319 (/client): East()
It's possible that you defined "Safe" variable for a subtype of /area