datum
verb
Cut_Battle_Area(mob/M)
var/list/Pasting_Turfs = new()
var/list/PTLocx = new()
var/list/PTLocy = new()
var/Mx
var/My
for(var/turf/T in block(locate(M.x-5,M.y-5,M.z),locate(M.x+5, M.y+5,M.z)))
Pasting_Turfs += T.type
PTLocx += T.x
PTLocy += T.y
Mx = M.x
My = M.y
Paste_Battle_Area(M,Pasting_Turfs, PTLocx, PTLocy, Mx, My)
Paste_Battle_Area(var/mob/M as mob, var/list/PT as anything, var/list/PTx as anything,
var/list/PTy as anything, var/Mx as num, var/My as num)
world << "----output"
for(var/area/Battlefield/A in world)
if(A.In_use) continue
else
M.loc = locate(A.tag)
A.In_use = 1
for(var/i = 1 , i < PT.len, i++)
var/turf/A
var/X
var/Y
world << PT[1]
X = PTx[i] - Mx
Y = PTy[i] - My
var/T = text2path(PT[i])
world << X
world << Y
world << "-----end output"
if(X < 0 && Y < 0)
new T(Mx-abs(X), My-abs(Y), M.z) // bottom left
else if(X > 0 && Y < 0)
new T(Mx+X, My-abs(Y), M.z) // bottom right
else if(X > 0 && Y > 0)
new T(Mx+X, My+Y, M.z) // top right
else
new T(Mx-abs(X), My+Y, M.z)// top left
A = A
Problem description:
runtime error: Cannot create objects of type null.
verb name: Paste Battle Area (/datum/verb/Paste_Battle_Area)
source file: Tactics - Battle System.dm,63
usr: Mechanios (/mob)
src: Mechanios (/mob)
call stack:
Mechanios (/mob): Paste Battle Area(Mechanios (/mob), /list (/list), /list (/list), /list (/list), 29, 37)
Mechanios (/mob): Cut Battle Area(Mechanios (/mob))
----output
/turf/World/Base_Turfs/Grass
-5
-5
-----end output
Within Pasting_Turfs (PT) list is all of the turfs types. I've understood that the New() handles the placing so I haven't overwritten it or anything. what I don't understand is the "type null" part, as it has the type. do I need to define somewhere that its a turf?
Reason for debugging: To give us a better idea of what exactly the problem could be and how we can help you (or you help yourself).
- GhostAnime