obj
Infected
var/Virus = list()
var/Type

New()
src.Airborne()

proc
Airborne()
set waitfor = 0
var/direction
while(src)
direction = pick(NORTH,SOUTH,EAST,WEST)
var/turf/thatDirection = get_step(src,direction)
var/clearDirection = 1

if(thatDirection)
clearDirection = !thatDirection.density

for(var/atom/someAtom in thatDirection)
if(someAtom.density==1)
if(!(istype(someAtom,/mob)))
clearDirection = 0

if(!(locate(type) in thatDirection) && clearDirection)
step(src,direction)

sleep(10)

Move()
var/obj/Infected/I = new
I.Virus = "Airborne"
var/turf/InfectedPlace = src.loc
InfectedPlace.Infected = 1
I.loc = src.loc
Click()

world << Type
var/obj/Infected/I = new


Then your Airborne proc starts and calls that again if the object can move. The created object then repeats this behavior, stacking and causing your errors more than likely.

What it looks like when you create a virus object:
  1. Create a new virus object at location.
  2. Can virus move? If so, do it.
  3. If the virus moved, create another virus object and call its Airborne proc. Meanwhile, the first virus object continues to create new objects every second (each repeating this behavior and stacking).


So how do i fix this
Bump
Page: 1 2